Kivy Core Concept - Using an `id` to Reference a Widget

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 77

  • @drarn96
    @drarn96 4 года назад +3

    That trick of use a print statement to know which ids are related to, is simply amazing

    • @erik-sandberg
      @erik-sandberg  4 года назад +2

      Oh yeah, absolute game changer :)

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @faraheadz
    @faraheadz Год назад

    literally spent 2hours trying to figure it out, thanks for the video

  • @RajeevKumar-Khurja
    @RajeevKumar-Khurja 2 года назад

    Bhai badiya aapne dil khush kar diyaa
    Ek Indian ki taraf se
    From An Indian

  • @ans7452
    @ans7452 3 года назад

    Best kivy and kivymd tutorial...

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @tahep3906
    @tahep3906 3 года назад +1

    Until I come across to this video it used to take me a lot of time to reach the widgets in my custom widgets and I have had to write very long lines to reach them, now everything is crystal clear to me, thanks a lot for this helpful video

  • @upcomingvillain
    @upcomingvillain Год назад

    I’m new to programming and Kivy and this basic idea I just couldn’t find/comprehend but you really helped man! Thank you!

  • @macbcheesy
    @macbcheesy 2 года назад

    I really appreciate the way you explain things.

  • @Devon-bf9xh
    @Devon-bf9xh 4 года назад +1

    You're actually a god i've been stuck on this for so long

    • @vagabond4100
      @vagabond4100 4 года назад +1

      Yess mee too. Finally I can finish my project 🔥🔥🔥

    • @R7amos
      @R7amos 3 года назад +1

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @xx113355
    @xx113355 4 года назад +1

    Erik, thank you for very interesting and useful videos of kivymd. My name is Audrey, I live in Moscow, Russia.

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @bylittlewind
    @bylittlewind 2 года назад

    Thanks for the debug-advise! You are amazing man!

  • @atharvasaney3376
    @atharvasaney3376 3 года назад +1

    dude you are amazing
    thanks a lottt!!!

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @Александр-р3э3м
    @Александр-р3э3м 4 года назад

    I am on 1:20 and i already know this gonna be awesome tutorial!)

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @zakarialabiad9435
    @zakarialabiad9435 5 лет назад +1

    Erik your work is very helpfull . thanx for sharing your information with Us ♥

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @pmoaro
    @pmoaro 5 лет назад +2

    Awesome tutorial. Need help on a previous tutorial(MDToolbar). How can i use the vertical dots to open a dropdownmenu with 4 items(label 1, label2, label3, label4)?

    • @erik-sandberg
      @erik-sandberg  5 лет назад +1

      For the dropdown menu you'll need to use the MDDropdownMenu widget. I'll have a video coming on that one soon :)

    • @pmoaro
      @pmoaro 5 лет назад

      @@erik-sandberg Awesome :D. Thank You. Will be patiently waiting.

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @unusedTV
    @unusedTV 4 года назад +1

    I can't believe this isn't listed anywhere on the docs. Thanks!

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @cr3amyn3ll66
    @cr3amyn3ll66 4 года назад

    Thank you very much for this helpful video.

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

    • @cr3amyn3ll66
      @cr3amyn3ll66 3 года назад

      @@R7amos I will look into it but I can't guarantee anything

    • @R7amos
      @R7amos 3 года назад

      @@cr3amyn3ll66 Ok

  • @mohammadirmansyah9913
    @mohammadirmansyah9913 4 года назад

    Excellent tutorial, many ways to Rome in kivy.

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @MrSuvidh
    @MrSuvidh 4 года назад +2

    @6:55 What if I want to add SpecialGridLayout dynamically from python code from another class.

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @harshulanand7334
    @harshulanand7334 3 года назад +1

    please help!:
    i have created a special class and i have not used it in the builder string but used it in a dialog box like this
    content = Secialclass()
    in that special class i have a text field
    how do i reference text in that?
    if i add the special class in main builder srting the text field comes on the mai page and in dialog box too

  • @upcomingvillain
    @upcomingvillain Год назад

    Ok so this works good on the same screen, how would you reference 1 screens text input and update a label on screen 2?

  • @jayzeenator4862
    @jayzeenator4862 4 года назад +1

    I'm getting "super' object has no attribute '__getattr__'" error, im using kivymd

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @r.castro340
    @r.castro340 2 года назад

    Very explicit tutorial Erik. Its very difficult to get clear explanations on ids. One question I have is, when do ids get created? This is the situation: i have a set of labels that need to be populated prior to showing the screen. How would you tackle it? Thanks.

  • @infinitespace1982
    @infinitespace1982 3 года назад

    Is there a way to set id in the main file, instead of the kv file?

  • @Hamheadon
    @Hamheadon 2 года назад

    Can you use the id for layouts

  • @jonasstrabel
    @jonasstrabel 4 года назад

    Nice work, keep it up!

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @iDabbl
    @iDabbl 2 года назад

    how do i access these ids from another class, inside of the main.py script?

  • @amateurastronomer
    @amateurastronomer 4 года назад +1

    AttributeError: 'PongGame' object has no attribute 'root' I am getting this error when I am trying to refer label like this
    player1_score = self.root.ids.score1

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @derex47
    @derex47 3 года назад

    When i add TextInput: to my kv file it breaks my window any ideas how to fix this?

  • @phanikashyappingali9024
    @phanikashyappingali9024 4 года назад

    I have been working on this project where I need to to change the text of a label according to a the text written in a textinput in a different screen..... Is there a way to do that.

  • @sigurdvingelsgaard9466
    @sigurdvingelsgaard9466 3 года назад

    how can I assign a variable to the reference of my widget in my class instead of in a function?

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @amonnoma1370
    @amonnoma1370 4 года назад

    In .Py file why do you write ids instead of id as mentioned in .kv file?

  • @santiagomontoya8288
    @santiagomontoya8288 4 года назад +1

    usted se llama edwin?

  • @niloydas1224
    @niloydas1224 4 года назад

    When should one use ':' and when '=' in kv file?

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @davidmurphy563
    @davidmurphy563 4 года назад

    I'm having big problems with referencing ids. I wonder if you might help. I've had to initialise the method and the parent class FloatLayout. This is for an ebook reader so I've got an object instance of the book contents which I'm passing about between methods and classes as I parse the info. My problem is that it will only accept "self" in the __init__ method - not from any of my other methods- which is a nightmare. When there's an event in KV, easy-peasy - I can just send it straight to python or to another widget. When there's an event in python (eg, I want to get self.height for an id within a loop) then I'm finding I can't just reference a module in the root class that returns self.root.ids.id_name.height...
    If I pass "self" it thinks I'm referring to by book loading instance (nothing to do with kivy) and I know of no way to explicitly name the object to fetch the id.
    It's kinda set up like this (boiled down version):
    :
    FloatLayout:
    id: some_id
    Label:
    id: some_other_id
    --- --- ---
    class RootClass(FloatLayout):
    def __init__(self, **kwargs):
    super(MyLayout, self).__init__(**kwargs)
    someVariable = self.root.ids.some_other_id.height

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @R7amos
    @R7amos 3 года назад

    Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @hellocodeur
    @hellocodeur 3 года назад

    thank u very much, this video helped me a lot. if it was possible on youtube to like one video 1000 times, i will put on this video

  • @chrisw5509
    @chrisw5509 4 года назад

    Superb video! I would like to see you generate a CRUD Kivy / Python video that focuses on adding, deleting, updating, etc. records in a database.

    • @erik-sandberg
      @erik-sandberg  4 года назад

      I have videos like that uses Google Firebase's Real-time Database, if you just search for "kivy firebase" on youtube you'll see a couple!

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

    • @chrisw5509
      @chrisw5509 3 года назад

      @@erik-sandberg Thanks! Your suggestion resulted in me being able to create CRUD Kivy / KivyMD / Python Apps that met my needs. I'm an extreme novice with regards to Python / Kivy / kivyMD. You have been a GREAT help!

  • @OnlineMoviesongs
    @OnlineMoviesongs 3 года назад

    can you do something like search video.

  • @sci3nttechable611
    @sci3nttechable611 5 лет назад

    Hi Erik - perhaps you could shed some light on this: My root widget is a FloatLayout, divided into two GridLayouts of 0.1 and 0.9 respectively (I want a "top menu" which is persistent throughout the app, as in friendly fitness). Is there anyway I can make the loginscreen override this logic (I don't want the "top menu" to be visible before you log in). Or is there a more elegant way to solve this?

    • @erik-sandberg
      @erik-sandberg  5 лет назад +2

      Try having your root widget be a ScreenManager. Then the first screen of the screenmanager should be your login screen. Once the user logs on, switch screens to your 2nd screen, which is your current FloatLayout. Your 2nd screen code would be all the exact code you have right now, except indented once with a Screen widget before the Floatlayout.

  • @code_nero
    @code_nero 4 года назад

    Bro you are just like my elder brother which doesn't exit but, you are guiding me through your videos
    Please also upload a video a video about packaging kivy app for windows 🙏

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @corollagl82
    @corollagl82 2 года назад

    the main windows is loading but not the widgets

  • @АртемВоронин-д2т
    @АртемВоронин-д2т 4 года назад

    Erik thanks for this tutorial! Could you make a tutorial how to make number picker (scrollin wheel number picker) by using kivy? If it's possible... Thanks in advance!

    • @R7amos
      @R7amos 3 года назад

      Hello can you help me with the code in kivymd!! I want to store data in the form of dictionary which when user inputs certain keyword , the value stored in the dictionary related to the keyword print in the app!!

  • @muhamedqasim5390
    @muhamedqasim5390 3 года назад

    I can't set id in kivy v2.0 any more with python like that Button(id="myid") I hate kv scripts

  • @zakarialabiad9435
    @zakarialabiad9435 5 лет назад

    can u drop your facebook account pls ? Ide discuss some point and ideas with u if u have time for that