Re: Interrupts?



On 02/05/01 Bogdan M.Maryniuck wrote:
For example, I have a window widget:

sub blablabla {
    $win_one->show();
}

sub button_close {
    $win_one->hide();
}

...and all working ok. BUT! If user closes window *NOT* by
my "Close" button (sub button_close), but by [x] button (via
windowmanager), then calling once again the sub "blablabla"
black window appears with error:

Mon Feb  5 13:46:42 2001 Gtk-LOG **: file gtkstyle.c: line 522
(gtk_style_attach): assertion `style != NULL' failed. at ./gobackup2.pl
line 2249.
Mon Feb  5 13:46:42 2001 Gtk-LOG **: file gtkstyle.c: line 1128
(gtk_style_set_background): assertion `style != NULL' failed. at
./gobackup2.pl line 2249.
Mon Feb  5 13:46:42 2001 Gtk-LOG **: file gtkstyle.c: line 3532
(gtk_paint_flat_box): assertion `style != NULL' failed. at
./gobackup2.pl line 2249.

...and my application HANGZ. :o( What I must to do? Same problem, if
user wants tu quit application
by WM [x] button, not by my "Close" -- application still working. How to
fix it?

When the user closes a window through the window manager, a "delete_event"
signal is sent to the window: if you don't handle it, the window is
destroyed and you get the warnings above when trying to show it again.
After that, the application is still in its main loop, so it may look like
it hung.
So you should connect to the delete_event signal and return a TRUE value
if you want the window to stay alive (this usually only makes sense
for dialog windows and the like if you don't want to rebuild them all the time).

lupus

-- 
-----------------------------------------------------------------
lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better




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