[pygtk] hide on delete_event()
Steve McClure
smcclure at racemi.com
Sat Dec 6 00:42:26 WST 2008
On Dec 5, 2008, at 10:33 AM, Peyman wrote:
> Hi Steve
>
> I'm pretty sure you are supposed to return True. In any case, I
> tried both (brute force is always a good last resort), and neither
> work.
>
> If it makes any difference, I'm using glade 2.0
I'm sorry, I misread my own code. It's been a while since I looked at
that.
>
>
> Cheers
>
>
> Peyman Askari
> On 5 Dec 2008, at 15:26, Steve McClure wrote:
>
>>
>> On Dec 5, 2008, at 10:21 AM, Timo wrote:
>>
>>> Peyman schreef:
>>>> Hello
>>>>
>>>> I am new to this mailing list. Originally I was posting to the
>>>> glade
>>>> mailing list
>>>>
>>>> My question is a simple one, I want my window to hide when I
>>>> close it
>>>> (by clicking 'x'). I have browsed the web and the answer appears
>>>> to be
>>>>
>>>> def on_window_delete_event(widget,data,wtree):
>>>> print "If you can read this, then everything should work fine"
>>>>
>>>> widget.hide()
>>>> return gtk.TRUE
>>>>
>>>>
>>> I don't know if it matters, but try
>>> return True
>>> instead of return gtk.TRUE.
>>>
>>>> But when I do this very exact thing it still gets destroyed. And
>>>> later
>>>> when I call the drawingArea widget (inside the window) it claims
>>>> there
>>>> is no such widget.
>>>>
>>>> Anyone else run into this problem?
>>
>> You need to return False, instead of True, to keep the dialog from
>> being destroyed.
>>
>>>>
>>>>
>>>> Thank You
>>>>
>>>>
>>>> Peyman Askari
>>>> _______________________________________________
>>>> pygtk mailing list pygtk at daa.com.au
>>>> http://www.daa.com.au/mailman/listinfo/pygtk
>>>> Read the PyGTK FAQ: http://faq.pygtk.org/
>>>>
>>>
>>> _______________________________________________
>>> pygtk mailing list pygtk at daa.com.au
>>> http://www.daa.com.au/mailman/listinfo/pygtk
>>> Read the PyGTK FAQ: http://faq.pygtk.org/
>>>
>>
>> --
>> Steve McClure
>> smcclure at racemi.com
>>
>
>
--
Steve McClure
smcclure at racemi.com
More information about the pygtk
mailing list