Python Forum
thinker button gui place next to each other
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
thinker button gui place next to each other
#4
Quote:Right now it display ping and clear is not place together.
if i put pack(side"left"), it will look really strange.

If you just try to pack it to side left then it is going to attempt to center it on the Y axis making it far down. You have to anchor it the north.

try using anchor to northwest
tk.Button(my_gui,text="Ping Test", bd=2, command=ping).pack(side='left', anchor='nw') 
tk.Button(my_gui,text="Clear", bd=2, command=clear_text).pack(side='left', anchor='nw') 
Or a little more uniformed
tk.Button(my_gui,text="Ping Test", bd=2, command=ping).pack(side='left', anchor='nw', padx=25) 
tk.Button(my_gui,text="Clear", bd=2, command=clear_text).pack(side='right', anchor='ne', padx=25) 
or even more uniformed
tk.Button(my_gui,text="Ping Test", bd=2, command=ping).pack(side='left', anchor='n', fill='x',expand='yes') 
tk.Button(my_gui,text="Clear", bd=2, command=clear_text).pack(side='right', anchor='n', fill='x',expand='yes') 
 
depending on your tastes.
Recommended Tutorials:
Reply


Messages In This Thread
RE: thinker button gui place next to each other - by metulburr - Jun-26-2019, 10:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Place QT Window in the middle AlphaInc 10 2,258 Aug-03-2023, 05:40 PM
Last Post: Axel_Erfurt
  [Tkinter] how to make label or button not visible with the place method? nowayj63 2 2,857 Jan-03-2023, 06:29 PM
Last Post: Yoriz
  Label.Place did not work? ATARI_LIVE 15 5,339 Sep-18-2020, 04:22 PM
Last Post: ATARI_LIVE
  [Tkinter] How to place scroll bar correctly scratchmyhead 1 3,968 May-18-2020, 04:17 PM
Last Post: scratchmyhead
  How to use place holders in tkinter sqlite scratchmyhead 1 1,838 May-12-2020, 06:13 PM
Last Post: Larz60+
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,043 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp

Forum Jump:

User Panel Messages

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