I try to use the lower() method to make a button invisible (it should still take up it's space), but I always get the error message "can't lower widget .... below". I have seen this problem discussed already in various forums, and I tried to apply the solution, which is usually provided as a response, but it still doesn't work for me, so maybe I misunderstood something. Here is the relevant part of the code:

Note: From what I read, I have learned that we can not lower a widget below its parent, but we can bypass this restriction by using the '_in' parameter of the packer (or grid manager). My guess is that I didn't use this parameter properly.

Thank you for providing your suggestion. I will try it, but a few questions:

(1) I already received in the past the suggestion to inherit my class from 'object'. Is this just good style (so that the methods applying to all objects, can also be uniformly applied to my class as well), or does this have additional importance for my case?

(2) Why is it important to use padx/pady, when packing self.widget, and how do you arrive at especially those magical value of 5? I thought this would only effect the way it looks (i.e. giving kind of an internal border), so it's more a question of aesthetics, whether we want padding. Since you write "was missing", I assume that this padding is necessary here. Could you explain why?

(3) I have read about pack_forget(), but my understanding was, that with this method, the widget simply disappears and the other (sibling-) widgets will take up its space. This was described here: http://stackoverflow.com/questions/3819 ... ot-visibleIn this thread, it was suggested that, if we want the space occupied by the disappearing widget, still be reserved, we have to use the lower() method in it. Is there a possibility to use lower() for my problem? Or did I simply misunderstand the explanations in that posting at stackoverflow?

(4) In another forum, I found the suggestion to make the button foreground the same colour than the button background. Since I disable the button anyway during the time it is hidden, this seems to be a possible approach too, but it feels a bit like a hack to me. What do you think about this solution?

rovf wrote:(2) Why is it important to use padx/pady, when packing self.widget, and how do you arrive at especially those magical value of 5? I thought this would only effect the way it looks (i.e. giving kind of an internal border), so it's more a question of aesthetics, whether we want padding. Since you write "was missing", I assume that this padding is necessary here. Could you explain why?

a) The padx and pady is not of importance it's really just aesthetics.b) The 5 is not a magical value you can choose any positive integer value.c) Why packing the 'widget'. Try out my following script which is omitting the packing of 'widget':

A wish and tip from me when you next time show a script in this Forum show it as executable test skript. When you look at my script you can see your self how much additional effort was necessary to test it. Thanks.

A wish and tip from me when you next time show a script in this Forum show it as executable test skript.

I tried to avoid posting code which I believed to be not necessary for that example (actually, I thought I just made a simple mistake in my usage of lower()), and copied only that part from my application which I considered relevant. But you are right, especially in this case the minimum running example would have been much more useful, and not much longer than what I had posted.

(1) I already received in the past the suggestion to inherit my class from 'object'. Is this just good style (so that the methods applying to all objects, can also be uniformly applied to my class as well), or does this have additional importance for my case?

(3) I have read about pack_forget(), but my understanding was, that with this method, the widget simply disappears and the other (sibling-) widgets will take up its space. This was described here: http://stackoverflow.com/questions/3819 ... ot-visibleIn this thread, it was suggested that, if we want the space occupied by the disappearing widget, still be reserved, we have to use the lower() method in it. Is there a possibility to use lower() for my problem? Or did I simply misunderstand the explanations in that posting at stackoverflow?

a) You are right the pack_forget() method doesn't work corecctly. Instead use grid_remove.b) The 'lower'- or 'lift'-methods do not work with widgeds which are embedded in a master widget because they can't be lower below or lift above the master. But the lower- lift.methods are working with widgets within a master when they have the same master reference.With the following scripts you can all posibilities.

def close(self): # Add here things which have to be done before shutdown self.win.destroy() print ("Shut down application")

def run(self): self.win.mainloop()

Test(TEST_TITLE).run()

(4) In another forum, I found the suggestion to make the button foreground the same colour than the button background. Since I disable the button anyway during the time it is hidden, this seems to be a possible approach too, but it feels a bit like a hack to me. What do you think about this solution?