GTK--: hello.cc questions



Hi,

I am trying my first GTK-- application. I have GTK---0.9.9 and
GTK+-1.0.4.

Problem 1:
I have compiled the hello.cc and run it. If I press the button b,
everithing's OK. But if I close the window via the window manager, I get
this:

bash-2.01$ ./hello

** WARNING **: file gtkobject.c: line 1140 (gtk_object_get_data_by_id):
"GTK_IS_OBJECT (object)"

** WARNING **: gtk_signal_disconnect(): could not find handler (1)

Why do I get these messages ?

Problem 2:
I would also like to be able to control the closing of the window (to
prevent unsaved work to be lost). How can this be done ?

Problem 3:
Another question is related to the function from hello.cc, too:

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

This function is never called ! Why and how do I make it be called ?
(this can be checked by changing it in:

  gint destroy_event_impl(GdkEventAny *){
    g_print( "destroy event occured\n"); 
    Gtk_Main::instance()->quit(); 
    return 0;
  }

The message "destroy event occured\n" is never printed.)

TIA,

Ionutz



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