[Glade-users] Remove and create new gtk objects
- From: Duarte Duque <duarte_duque mail pt> (Duarte Duque)
- Subject: [Glade-users] Remove and create new gtk objects
- Date: Tue, 28 Jan 2003 16:04:51 +0000
Dear List Members,
I am trying to remove dynamically some objects from an gtk based program
and replace them with new objects. The problem occurs when I try to set
some events to the new objects that will be created.
There is what I am doing:
/***************************************************/
GtkWidget* create_window (void)
{
GtkWidget *window1;
GtkWidget *alarm;
gint z;
�
alarm = gtk_drawing_area_new();
gtk_widget_ref(alarm);
gtk_object_set_data_full(GTK_OBJECT(window1), �alarm�, alarm,
(GtkDestroyNotify)gtk_widget_unref);
gtk_widget_show(alarm);
gtk_fixed_put(GTK_FIXED(fixed1), alarm, 20, 40);
gtk_widget_set_uposition(alarm, 20, 40);
gtk_widget_set_usize(alarm, 10, 10);
z = 1;
gtk_object_set_user_data(GTK_OBJECT(alarm),(void *)z);
gtk_widget_set_events (alarm, GDK_BUTTON_PRESS_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
gtk_widget_set_extension_events (alarm, GDK_EXTENSION_EVENTS_CURSOR);
signal_disconnect_alarm[0] = gtk_signal_connect(GTK_OBJECT (alarm),
�realize�, �
signal_disconnect_alarm[1] = gtk_signal_connect(GTK_OBJECT (alarm),
�button_press_event�, �
signal_disconnect_alarm[2] = gtk_signal_connect(GTK_OBJECT (alarm),
�enter_notify_event�, �
signal_disconnect_alarm[1] = gtk_signal_connect(GTK_OBJECT (alarm),
�leave_notify_event�, �
�
return window1;
}
/***************************************************/
I can draw the new objects in the window, but the button_press_event, the
enter_notify_event and the leave_notify_event don�t work.
The stdout prints this errors messages when I try to create new objects:
Gtk_CRITICAL **: file gtkwidget.c: line 3824(gtk_widget_set_events):
assertion �GTK_WIDGET_REALIZED (widget)� failed
Any ideas?
Best Regards,
Duarte Duque
--
Crie o seu email gratuito no mail.pt
http://www.mail.pt
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]