Creating custom components in tkinter with classes and functions

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 23

  • @johnr.5475
    @johnr.5475 8 หลายเดือนก่อน +2

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

  • @dryandave
    @dryandave 7 หลายเดือนก่อน

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

  • @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)
      th-cam.com/video/1p_Y_QB3c1A/w-d-xo.htmlsi=V0XgF8VZvO5CUxsD

  • @dcoppola1988
    @dcoppola1988 3 หลายเดือนก่อน

    love your tutorials! thank you very much!

  • @nemoclyde1375
    @nemoclyde1375 11 หลายเดือนก่อน

    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

  • @janlochman1985
    @janlochman1985 8 หลายเดือนก่อน

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

    • @ClearAtlas
      @ClearAtlas  8 หลายเดือนก่อน +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?

  • @TheSantoshmenon
    @TheSantoshmenon 5 หลายเดือนก่อน

    good video

  • @magachipula9233
    @magachipula9233 ปีที่แล้ว +1

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

    • @janlochman1985
      @janlochman1985 8 หลายเดือนก่อน

      You cannot what?

  • @eldarmammadov9917
    @eldarmammadov9917 2 ปีที่แล้ว +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 8 หลายเดือนก่อน

      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 ปีที่แล้ว

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

    • @official1
      @official1 8 หลายเดือนก่อน +1

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

  • @FernandoSantos-on5ry
    @FernandoSantos-on5ry ปีที่แล้ว

    👏👏👏

  • @domdog111
    @domdog111 28 วันที่ผ่านมา

    These are great but the verbal explanation of individual components, visually presented on the screen, is redundant and time consuming, they frustrate by consuming time.

  • @activechaos128
    @activechaos128 ปีที่แล้ว

    Please fix the audio.

    • @janlochman1985
      @janlochman1985 8 หลายเดือนก่อน

      The audio sounds good, what problem do you have?