Hi,
I started to code my first gui with ruby and gtk with the help of glade.
Now everything works fine but I have two problems:
1.) If I exit my program via the X in the window-border (I hope you
understand what I mean. The X which is in every window in the
right-upper border) the window closes but the program keeps running. So
if I execute it in the console I have to push strg+c to make my process
end. How can I make my program finish if I push the X on the window?
2.) How do I invoka an error-dialog box? I know how to create one with
glade but how can I call it?
I started to code my first gui with ruby and gtk with the help of glade. Now everything works fine but I have two problems:
1.) If I exit my program via the X in the window-border (I hope you understand what I mean. The X which is in every window in the right-upper border) the window closes but the program keeps running. So if I execute it in the console I have to push strg+c to make my process end. How can I make my program finish if I push the X on the window?
That X in the right-upper corner triggers a delete-event.
In glade-2, in the signals tab of your main window, add an event for the
signal delete_event, then add in your ruby file a code similar to:
def on_YOURWINDOW_delete_event widget, event, data = nil
Gtk.main_quit
end
where YOURWINDOW is the widget name (in this case the main window)
2.) How do I invoka an error-dialog box? I know how to create one with glade but how can I call it?