Re: widgets aren't updated

2009-03-20 Thread Michael Torrie
Ma lin wrote:
 thanks for you help, before the description is not very accurate,
 
 gtk: gtk+-2.10.14
 directfb : DirectFB-1.0.0 (with intel gdl as gfxdriver)
 cairo:  cairo-1.4.2
 pango: pango-1.16.2
 cpu: intel Olo
 
 I used gtk_label_set_label to change my label text in my  button click
 callback,
 but string(old one) not clear , so new one was over old one.
 and I found that new one just cover old one if font width not change,
 otherwise, old one could be show ether.
 
 I have no ideal ,it's pango layout bugs or something else?
 thanks for help

The code appears to function without problem on GTK/X11.  Must be a
problem specific to pango on directfb.  I'm preserving the code below,
so that the other people on the list might take a look.

Michael


 example code:
 
 #include gtk/gtk.h
 
 GtkWidget *label;
 static void hello( GtkWidget *widget,
gpointer   data )
 {
 gchar buffer[10] = {'\0'};
 static int index=0;
 index ++;
 switch (index)
 {
 case 1:
 strcpy (buffer, really);
 break;
 case 2:
 strcpy (buffer, cover);
 break;
 case 3:
 strcpy (buffer, right);
 break;
 default:
 break;
 }
 if (index =3)
index = 0;
 gtk_label_set_text (GTK_LABEL(label), buffer);
 g_print (Hello World\n);
 }
 
 static gboolean delete_event( GtkWidget *widget,
   GdkEvent  *event,
   gpointer   data )
 {
 g_print (delete event occurred\n);
 
 return FALSE;
 }
 
 static void destroy( GtkWidget *widget,
  gpointer   data )
 {
 gtk_main_quit ();
 }
 
 int main( int   argc,
   char *argv[] )
 {
 GtkWidget *window;
 GtkWidget *button;
 GtkWidget *box;
 
 gtk_init (argc, argv);
 
 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 gtk_widget_set_size_request (window, 485, 108);
 
 g_signal_connect (G_OBJECT (window), delete_event,
 G_CALLBACK (delete_event), NULL);
 
 g_signal_connect (G_OBJECT (window), destroy,
 G_CALLBACK (destroy), NULL);
 
 gtk_container_set_border_width (GTK_CONTAINER (window), 10);
 
 box = gtk_hbox_new (TRUE, 0);
 
 button = gtk_button_new_with_label (Hello World);
 
 g_signal_connect (G_OBJECT (button), clicked,
 G_CALLBACK (hello), NULL);
 
 gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
 
 label = gtk_label_new (hello world);
 gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
 
 gtk_container_add (GTK_CONTAINER (window), box);
 
 gtk_widget_show_all (window);
 
 gtk_main ();
 
 return 0;
 }
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: widgets aren't updated

2009-03-19 Thread Michael Torrie
Ma lin wrote:
  Hi All,
 
 I am getting following assertion and my application is exiting. Could anyone
 help me to know what is the cause for this assertion? and how can I solve
 it.

You'll have to paste the output messages from the program at the very
least.  I see that you intended to post an example code snippet but I
don't see it in your message.

 
 Sometimes *some widgets aren't updated. *
 Renovates normally with edition gtk on PC, but platform establishes label in
 the target the content, the writing can fold puts together, does not
 renovate.*

I'm not sure what you are trying to say here.  Are you saying that
widgets sometimes update and sometimes not?  Do text labels overwrite
other labels leaving garbage on the screen?

Are you using threads?

 *In the attach is the example procedure, the platform is intel ce2110
 directfb+gtk.

I do not see any attachment to this e-mail.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list