gtk_fixed_move called from size-allocated event freezes the GUI

2008-12-17 Thread Giuseppe Torelli
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
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: status bars with multiples part

2008-12-17 Thread Luiz Rafael Culik Guimaraes

Hi Lance


I would just pack 4 different statusbars in an hbox, and have each 
statusbar have it's own information.
thanks for the info, but is possible to specify the size of each part of 
statusbar ?


Regards
Luiz 


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: status bars with multiples part

2008-12-17 Thread Lance Dillon
I believe you can set the size of a widget (gtk_widget_set_size_request).  That 
is the minimum size for the widget.  It can still be bigger if the containing 
widget is bigger.



- Original Message 
From: Luiz Rafael Culik Guimaraes l...@xharbour.com.br
To: Lance Dillon riffraff...@yahoo.com; gtk-app-devel-list@gnome.org
Sent: Wednesday, December 17, 2008 9:59:00 AM
Subject: Re: status bars with multiples part

Hi Lance


I would just pack 4 different statusbars in an hbox, and have each 
statusbar have it's own information.
thanks for the info, but is possible to specify the size of each part of 
statusbar ?

Regards
Luiz 


  
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: valgrind reports memory leak on g_main_loop_run

2008-12-17 Thread Alexander Semenov

Sune Ahlgren wrote:

Hi,

I use 1 GMain event loop in my main context for monitoring of events on file 
descriptors. I shut down my program by receiving a SIGTERM. In this signal 
handler I do the following:

   g_main_loop_quit(loop);  g_main_loop_unref(loop);  loop = NULL;

I've also tried to move:
   g_main_loop_unref(loop);  loop = NULL;to the very end of my main function. I 
still get:

==6087== 744 bytes in 3 blocks are possibly lost in loss record 7 of 9==6087==  
  at 0x4021C8A: memalign (vg_replace_malloc.c:460)==6087==by 0x4021D3E: 
posix_memalign (vg_replace_malloc.c:569)==6087==by 0x409391E: (within 
/usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x40950F2: g_slice_alloc (in 
/usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x404F55E: g_array_sized_new 
(in /usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x404F676: g_array_new (in 
/usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x40A0423: g_static_private_set 
(in /usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x4075A43: (within 
/usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x407606C: 
g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1600.6)==6087==by 
0x4079852: (within /usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x4079D71: 
g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1600.6)==6087==by 0x806F805: 
init (init.c:193)


I set up the main loop like this:
   loop = g_main_loop_new(NULL, FALSE);
   g_main_loop_run(loop);
What am I doing wrong?

BRs
/Sune
_
Senaste sportnyheterna  rykande färska resultat!
http://sport.msn.se/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

   

Hi.

T popular kind of question. Are you aware of 
http://live.gnome.org/Valgrind ?


Regards.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


status bars with multiples part

2008-12-17 Thread Luiz Rafael Culik Guimaraes

Dear Friends

is possible to create an statusbar in gtk with multiples parts?

example
part 1 show the filename, part 2 show row number, part 3 show col number, 
part 4 show ins/CAPS status on/off


Regards
Luiz 


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gint on gtk_entry_set_text

2008-12-17 Thread frederico schardong
Please look:

gint dado;

dado = inb(0x37A);

gtk_entry_set_text(GTK_ENTRY(entry2),dado);

Whow I can show gint in my entry2?

Tanks
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gint on gtk_entry_set_text

2008-12-17 Thread Tadej Borovšak
Hello.

I think this should work:
-
gint dado;
gchar *tmp;

dado = 0x37A;

/* replace %d with %x if you need your number in hex */
tmp = g_strdup_printf( %d, dado );
gtk_entry_set_text( GTK_ENTRY( entry2 ), tmp );
g_free( tmp );
-

2008/12/17 frederico schardong frede@gmail.com:
 Please look:

gint dado;

dado = inb(0x37A);

gtk_entry_set_text(GTK_ENTRY(entry2),dado);

 Whow I can show gint in my entry2?

 Tanks
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Tadej Borovšak
00386 (0)40 613 131
tadeb...@gmail.com
tadej.borov...@gmail.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list