tkinter - Resize window without covering widget -
this python-tkinter program uses pack geometry manager place text widget , "quit" button in root window -- text widget above button.
import tkinter tk root = tk.tk() txt = tk.text(root, height=5, width=25, bg='lightblue') txt.pack(fill=tk.both,expand=true) txt.insert('1.0', 'this text widget') tk.button(root, text='quit', command=quit).pack() root.mainloop()
when resize root window dragging lower border up, lose quit button. vanishes under root window's border. i'm trying quit button move along window's border, while letting text widget shrink. have played "fill" , "expand" in pack() , "height" in both widgets without success.
is there straightforward way keep quit button visible while dragging window smaller?
(while researching, noticed grid geometry "sticky" cells can accomplish task easily. i'm still curious know if there simple way same pack geometry.)
pack quit button before packing text widget. when window small contents starts shrink widgets in reverse order tat packed until can't shrink anymore, starts clipping widgets.
the text widget, being largest widget in window, can shrink lot before starts getting clipped.
Comments
Post a Comment