conversecorollary has asked for the wisdom of the Perl Monks concerning the following question:

I am using AS PERL 5.12 and Tkx and I have come across an unusual behavior with toplevel widgets. I know it is in my code, but I have yet to figure out where. The symptom is that the minimize button or the "system" menu minimize sometime fail to work. You click on them and nothing happens, but the maximize and close buttons work fine. Would anyone have any ideas as to what would cause this behavior? thanks gary

Replies are listed 'Best First'.
Re: Toplevel window/widget
by GrandFather (Saint) on Jun 28, 2011 at 00:49 UTC

    Show us a minimal script that demonstrates the problem so we can reproduce it.

    True laziness is hard work

      That is part of the problem... I tried a simplified example and I could not reproduce the problem. I know the issue is somewhere in my code. I know this is not the place for debugging many lines of code. So I thought it would be best to work this from the angle of what may cause this type of behavior? What would prevent a toplevel widget from minimizing? If I knew some causes, then I could look for those causes.

      Thanks again.

      gary

        Use the undo button in your editor to go back to just before the simplification step that made the problem go away then examine the code you were about to remove. The trick is to remove code that is unrelated to the problem until you have distilled the code down to a small sample that demonstrates the issue. Be warned, using this technique you may end up finding the solution yourself.

        True laziness is hard work

        What would prevent a toplevel widget from minimizing?

        Code

         

         

         

         

         

        For example, clicking a button triggers a callback (function).

        Clicking minimize button, triggers a callback

        The regular callback, changes the size of the window, it actually minimizes the toplevel window

        Maybe you override this callback, with your own callback, which does not perform minimization