Creating custom components in tkinter with classes and functions

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 22

  • @johnr.5475
    @johnr.5475 5 місяців тому +2

    Excellent videos. I’ve seen a few of yours now and they are really helpful. So clear and well explained. Thanks.

  • @dcoppola1988
    @dcoppola1988 13 днів тому

    love your tutorials! thank you very much!

  • @sonu-jangir
    @sonu-jangir Рік тому +3

    The more i praise you, the less it is.
    You are really awesome sir.❤

    • @SabinPoudel
      @SabinPoudel Рік тому

      Check out
      Expense tracker Customtkinter project (modern GUI)
      ua-cam.com/video/1p_Y_QB3c1A/v-deo.htmlsi=V0XgF8VZvO5CUxsD

  • @dryandave
    @dryandave 4 місяці тому

    That very detailed tutorial master, thank you for your generosity.

  • @nemoclyde1375
    @nemoclyde1375 8 місяців тому

    actually, you can pack in function :
    def create_segment(parent, label_text: str, btn_text: str):
    frame = Frame(master=parent)
    # Grid Layout
    frame.rowconfigure(0, weight=1)
    frame.columnconfigure((0,1,2), weight=1, uniform="a")
    label = Label(frame, text=label_text, anchor="center").grid(row=0, column=0, sticky="nsew")
    button = Button(frame, text=btn_text).grid(row=0, column=1, sticky="nsew")
    frame.pack(side="top", expand=True, fill="both", padx=10, pady=10)
    return frame
    and return it in a variable for future actions (pack_forget() etc..)
    segment_08 = create_segment(window, label_text="label 08", btn_text="button 08")
    PS : Thank you so much for these great quality courses, (Pygame

  • @TheSantoshmenon
    @TheSantoshmenon 2 місяці тому

    good video

  • @janlochman1985
    @janlochman1985 5 місяців тому

    So you decide on OOP or functional regarding the amount of code needed right?

    • @ClearAtlas
      @ClearAtlas  5 місяців тому +3

      kinda: If the project is very simple then functions are fine but once it gets even a bit more complex you want classes. Might even be a good idea to go with classes by default

  • @muhammadsyukri_channel
    @muhammadsyukri_channel Рік тому

    Hi, thanks for the video

  • @mrpeace3860
    @mrpeace3860 Рік тому

    If I do this with checkboxes, and I click one, every checkbox is marked - why is that?

  • @eldarmammadov9917
    @eldarmammadov9917 Рік тому +1

    Segment class has row 0. How they appear like under each other row 1, row 2...

    • @vkp111
      @vkp111 Рік тому +1

      I think all labels are placed in row 0, column 0 and all the buttons are placed in row 0, column 1

    • @janlochman1985
      @janlochman1985 5 місяців тому

      That is because widgets in that segment use pack() geometry manager, which automatically, by default, places widgets from top to bottom. So the window is divided into a grid of one row and three columns by a grid() geometry manager, while in each cell of the third column, he is creating kind of two rows, but since he is using the pack() method, we can't talk about 2nd row. They are just two rows under each other. If he would add side attribute to ttk.Entry and ttk.Button with the value "left" wouldn't look like two rows but just one.

  • @magachipula9233
    @magachipula9233 Рік тому +1

    I cannot class-based code, what could the problem be?

  • @FernandoSantos-on5ry
    @FernandoSantos-on5ry Рік тому

    👏👏👏

  • @magachipula9233
    @magachipula9233 Рік тому

    I am failing to run this Class based app, what could be the problem?

    • @official1
      @official1 5 місяців тому +1

      If you don’t give any more details nobody can help you. You should always give the error code

  • @activechaos128
    @activechaos128 Рік тому

    Please fix the audio.

    • @janlochman1985
      @janlochman1985 5 місяців тому

      The audio sounds good, what problem do you have?