Quitting gracefully in Gtk--



Hello,

I have som questions concerning some features of Gtk--.

1.  If I have a class like:

     class My_Window : public Gtk_Window {

         public:

          gint delete_event_impl( GdkEventAny* ) {
              Gtk_Main::instance()->quit();
              return 0;
          }
          void on_quit_activate() {
              Gtk_Main::instance()->quit();
          }

     //code deletet for purpose of clarity
     }

with a some stuff on it and a menubar with a Quit button.
Then when I delete the window everything works fine.
However when I press the Quit button the window dissappears
and I get a Seg-fault or Bus error.

There is the same problem with the planet example included with the
distribution.
I suspect this has to do with the other delete event-handlers not being
called properly
(if I change the return from delete_event_impl() to a 1 the program also
seg-faults.)

Is there a way to quit more gracefully? Is it due to some error in Gtk--
or the compilation
(I run Gtk-- 1.0.1 on top of gtk+-1.2.3 with glib-1.2.3 on an IRIX 6.5
with the native compiler)

2. Why does a window resize (on my platform anyway) generate one
configure event followed by *two* expose events?

Thank you!

/Calle




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