how to simplify toggleMinimize

2005-07-16
2013-04-15
  • Mike Spiegle
    Mike Spiegle
    2005-07-16

    In the .pypanelrc file, I set the task action like this:

    #-------------------------------------
    def taskButtonEvent(pp, button, task):
    #-------------------------------------
        """ Button event handler for the panel's tasks """

        if button == 1:
            pp.toggleMinimize(task,traise=1)
        elif button == 2:
            pass
        elif button == 3:
            pass
        elif button == 4:
            pass
        elif button == 5:
           pass

    I wanted to make the pypanel taskbar function a little more like windows.  If the window that i'm currently using is minimized, I want it to be focused and raised.  If the window is currently focused and raised, i want it to be minimized.  I tried a few different combinations of code, but couldn't get exactly what I wanted.

    Thanks in advance!