In an application I'm making I need some buttons to be completely hidden (not like the state="disable"
one that disables the button but leaves it visible).
Is there a command or something to do that?
In an application I'm making I need some buttons to be completely hidden (not like the state="disable"
one that disables the button but leaves it visible).
Is there a command or something to do that?
Usually this involves removing the widget from the window (without destroying it). It depends on the method (geometry manager) you use to position the widget in the window/parent:
In the case of
grid
orpack
the other widgets are rearranged to occupy the space left free. To show the widget again, callpack
/place
/grid
again.If we are using it, it
grid
is usually preferable to usegrid_remove
, since when it comes to showing the widget again, the original configuration is remembered so it is enough to dobtn.grid()
, without having to specify row, column, etc. again.An example
place
that demonstrates how to hide and redisplay a button: