Tkinter: How to remove stacking order of a widget in grid manager
s2mdalle at titan.vcu.edu
Wed Feb 7 01:31:43 CET 2001
In article <3A80712D.BAF8FC0D at pacific.net.hk>, "Bernie"
<bernie at pacific.net.hk> wrote:
> Below is the code fragment:
> # remove widget from Grid Display manager
> for w in widget_list
> # re-ordering the widget
> widget_list.sort( mySort) # mySort() is not listed
> # display widgets in new orders
> col = range(5) row = 0 for w in widget_list:
> for i in col:
> w.grid( column = i, row = row)
> row = row + 1
I think what the problem is that it has to be done
in the parent, not the child. So if 5 things are
grid() into a widget called wid, then
wid.grid_forget() will ungrid all of the items.
By calling grid_forget on the items you want to take
out of the grid, you're unpacking their subitems
but not them.
f = Frame(parent)
b = Button(f, text="Foobar")
if you then want to get rid of b, you do
Hope this helps.
"I must say that I find television very educational. The minute
somebody turns it on, I go to the library and read a book."
More information about the Python-list