!GTK_WIDGET_REALIZED
- From: Robert Wilhelm <robert physiol med tu-muenchen de>
- To: gnome-list gnome org
- Subject: !GTK_WIDGET_REALIZED
- Date: Mon, 9 Mar 1998 12:59:41 +0100
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]