Python Forum
[Tkinter] alignment ,seems to be a frame in the way [fixed]
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] alignment ,seems to be a frame in the way [fixed]
#1
   

im having huge trouble getting the 2nd row to line up to the left. the dirt settings frame i can move left with sticky="w" but the others in the row remain as they are. i new to python so it has to be something simple im missing.

thx for any help.

        controls_frame = tk.Frame(root)
        controls_frame.grid(row=0, column=0, padx=10, pady=10, sticky="ew")

        stripe_frame = tk.LabelFrame(controls_frame, text="Stripe Settings", padx=10, pady=10)
        stripe_frame.grid(row=0, column=0, padx=10, pady=10, sticky="n")

        shape_frame = tk.LabelFrame(controls_frame, text="Shape Settings", padx=10, pady=10)
        shape_frame.grid(row=0, column=1, padx=10, pady=10)

        bg_frame = tk.LabelFrame(controls_frame, text="Background Settings", padx=10, pady=10)
        bg_frame.grid(row=0, column=2, padx=10, pady=10, sticky="n")

        dirt_frame = tk.LabelFrame(root, text="Dirt Settings", padx=0, pady=0)
        dirt_frame.grid(row=1, column=0, padx=10, pady=0, sticky="w") 
 
        wear_frame = tk.LabelFrame(root, text="Wear Settings", padx=0, pady=0)
        wear_frame.grid(row=1, column=1, padx=10, pady=0, sticky="ew")
               
        run_frame = tk.LabelFrame(root, text="Run Insignia Script", padx=10, pady=10)
        run_frame.grid(row=1, column=3, padx=10, pady=10, sticky="n")

        create_mod_frame = tk.LabelFrame(root, text="Create Mod", padx=0, pady=0)
        create_mod_frame.grid(row=1, column=2, padx=10, pady=0, sticky="n")

Attached Files

.py   main.py (Size: 22.6 KB / Downloads: 92)
Reply
#2
stripe settings is created within your 'controls_frame' where you use a sticky of north
dirt settings is created from the 'root' window, not from within a frame at all, and uses a sticky of east

You should keep both within the same frame to ease the alignment issues.
Hyster likes this post
Reply
#3
big thx Larz60+, sorted it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Vertical Tabs Alignment in Tkinter muhammadasim 2 7,960 Oct-05-2020, 08:40 AM
Last Post: Larz60+
  [Tkinter] Scrollbar, Frame and size of Frame Maksim 2 10,980 Sep-30-2019, 07:30 AM
Last Post: Maksim
  [Tkinter] create and insert a new frame on top of another frame atlass218 4 14,596 Apr-18-2019, 05:36 PM
Last Post: atlass218
  [Tkinter] Frame size only works if frame is empty(Solved) Tuck12173 7 8,065 Jan-29-2018, 10:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020