[Glade-users] Signal question.



This is a topic from a couple of months back between Alexey and Peter  
Keller, and I have just run into the exact same problem. However, this  
solution is not working for me

I have a main window, which opens a pop up window. And when I close  
the pop up window (by pressing the 'x' in the corner) it destroys the  
pop up window, and I can no longer open it again. I esentially want  
the pop up window to hide, instead of being destroyed.

I have tried connecting the on _pop_up_window_destroy_event,on  
_pop_up_window_destroy and on _pop_up_window_delete_event such that  
the window should hide

def on _pop_up_window_destroy_event(widget,data,wtree)
         widget.hide()
        return True

def on _pop_up_window_destroy_event(widget,data,wtree)
         widget.hide()
        return True

def on _pop_up_window_destroy_event(widget,data,wtree)
         widget.hide()
        return True

It doesn't make a difference, the window is still destroyed. Also I  
don't know why i'm returning True, just blindly following the previous  
advice.

Any help would be appreciated

Cheers
Peyman Askari

On 13 Oct 2008, at 21:29, Alexey Kurochkin wrote:

On Mon, 2008-10-13 at 10:41 -0500, Peter Keller wrote:
Hello,

When implementing the generic Help->About menuitem using glade-3 and
gtk+-2.0, I have it call a signal which gtk_widget_shows the dialog
box. For the dialog box, the response function (which is apparently  
the
close button) end up calling gtk_widget_hide to make it go away.

However, when I close the window using the window manager buttons in
the corner of the window, it seems the dialog box is forever  
destroyed
and unable to be gotten back again.

I've tried connecting a signal to the GtkObject destroy signal to  
hide
the window instead, and it is called--but the window is destroyed  
anyway.

Any suggesstions?

I do not think GtkObject's "destroy" is the right signal. You might  
want
to try connecting gtk_widget_hide_on_delete() to "delete-event" signal
on the widget, or any custom function for that matter which would call
gtk_widget_hide() and return TRUE.

_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]