gtk_fixed_move called from size-allocated event freezes the GUI
- From: "Giuseppe Torelli" <colossus73 gmail com>
- To: gtk-app-devel-list gnome org
- Subject: gtk_fixed_move called from size-allocated event freezes the GUI
- Date: Wed, 17 Dec 2008 09:53:35 +0100
Hi,
I have a gtk fixed widget with a viewport as a child. I connected the
size-allocated signal to the gtk fixed widget:
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX(vbox1), hbox, TRUE, TRUE, 0);
fixed = gtk_fixed_new ();
gtk_box_pack_start (GTK_BOX (hbox), fixed, TRUE, TRUE, 0);
img_struct->viewport = gtk_viewport_new(NULL,NULL);
gtk_fixed_put (GTK_FIXED (fixed), img_struct->viewport, 0, 0);
g_signal_connect (G_OBJECT (fixed), "size-allocate", G_CALLBACK
(img_size_allocate_event), img_struct);
I need to move a fixed size viewport when the user resizes the window
so in the handler I have:
static void img_size_allocate_event (GtkWidget *widget, GtkAllocation
*allocation, img_window_struct *img)
{
gint x,y;
x = (widget->allocation.width - 720) / 2;
y = (widget->allocation.height - 576) / 2;
if (x == 0 || y == 0)
return;
gtk_fixed_move(GTK_FIXED(widget),img->viewport,x,y);
}
This is the gdb stack:
(gdb) r
Starting program: /home/gt/Projects/imagination/src/imagination
[Thread debugging using libthread_db enabled]
[New Thread 0xb742f6c0 (LWP 17007)]
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xb742f6c0 (LWP 17007)]
0xb795a7dd in g_atomic_int_exchange_and_add () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0 0xb795a7dd in g_atomic_int_exchange_and_add () from
/usr/lib/libglib-2.0.so.0
#1 0xb7a0ca53 in g_object_ref () from /usr/lib/libgobject-2.0.so.0
#2 0xb7a0eef9 in ?? () from /usr/lib/libgobject-2.0.so.0
#3 0xb7a2d1ee in g_value_set_instance () from /usr/lib/libgobject-2.0.so.0
#4 0xb7a208bf in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#5 0xb7a20ed0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#6 0xb7d77536 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#7 0xb7d7776a in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#8 0xb7e3253f in gtk_widget_size_request () from /usr/lib/libgtk-x11-2.0.so.0
#9 0xb7cc9225 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#10 0xb7a1715a in g_cclosure_marshal_VOID__BOXED () from
/usr/lib/libgobject-2.0.so.0
#11 0xb7a09069 in ?? () from /usr/lib/libgobject-2.0.so.0
#12 0xb7a0a81f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#13 0xb7a1ebbb in ?? () from /usr/lib/libgobject-2.0.so.0
#14 0xb7a20c0f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#15 0xb7a20ed0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#16 0xb7d77536 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#17 0xb7d7776a in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#18 0xb7e3253f in gtk_widget_size_request () from /usr/lib/libgtk-x11-2.0.so.0
#19 0xb7e27c35 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#20 0xb7a1715a in g_cclosure_marshal_VOID__BOXED () from
/usr/lib/libgobject-2.0.so.0
#21 0xb7a09069 in ?? () from /usr/lib/libgobject-2.0.so.0
#22 0xb7a0a81f in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#23 0xb7a1ebbb in ?? () from /usr/lib/libgobject-2.0.so.0
#24 0xb7a20c0f in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#25 0xb7a20ed0 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#26 0xb7d77536 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
Where am I wrong?
--
Colossus
Imagination, a simple and lightweight DVD slide show maker -
http://imagination.sf.net
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.xfce.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]