!GTK_WIDGET_REALIZED




I just wanted to "gnomefy" a GTK application by replacing the toplevel
window with gnome_app_new().

However, I get following error when calling 
gtk_widget_set_events(app,  GDK_BUTTON_PRESS_MASK);

** WARNING **: file gtkwidget.c: line 2505 (gtk_widget_set_events): "!GTK_WIDGET_REALIZED (widget)"


Is it not possible to get callbacks from the gnome toplevel window?

Robert

=======================================================================================

#include <gnome.h>
GtkWidget *app;

static int press(GtkWidget* widget, GdkEventButton *event, gpointer data)
{
  printf("press\n");
}

int main(int argc, char *argv[])
{
  gnome_init ("foo",&argc, &argv);
  app = gnome_app_new ("foo", "Gnomified foo");
  gtk_widget_realize(app);

  gtk_widget_set_events(app,  GDK_BUTTON_PRESS_MASK);
  gtk_signal_connect(GTK_OBJECT(app),"button_press_event",GTK_SIGNAL_FUNC(press),NULL);
      
  gtk_widget_show (app);
  gtk_main ();

  return 0;
}



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