On Sun, 20 Mar 2005 20:08:59 -0800, Brian <[EMAIL PROTECTED]> wrote:
> This code does not always work as expected.  This is due to the
> new_window_state and changed_mask possibly having more than one flag
> attached.  The event.new_window_state and event.changed_mask are
> enumerated data types.

Hmm,  that is right. You may have to change the '==' tests to a
bitwise 'and' comparison:

(...)
>>> if state & gdk.WINDOW_STATE_ICONIFIED:
>>>    window.set_title('Iconified')
(...)

If you just want to have a flag to know that it is iconified you can
do something like:

class MyWindow(GtkWindow):
    def __init__(self):
        self.minimized = False
        ...

    def new_window_state(self, widget, event):
        state = event.new_window_state
        if state & gdk.WINDOW_STATE_ICONIFIED:
            self.minimized = True
        else
            self.minimized = False

I think that what you want to do is simple, so do not complicate it :)

[Eric Jardim]
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to