problem with status bar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Friends

how to add an status bar to an window. with the code bellow, my status bar 
is on top and the menu is bellow the status bar

here my code (with out menus)

GtkWidget * hWnd ;
   GtkWidget *vbox;
   GtkWidget *statusbar;
   GtkFixed * box;
   char *cTitle = "Teste";
   int x = 10;
   int y = 10;
   int width = 200;
   int height = 200;
   BOOL bStatus = 1;


   hWnd = ( GtkWidget * ) gtk_window_new( GTK_WINDOW_TOPLEVEL );

   cTitle = g_locale_to_utf8( cTitle,-1,NULL,NULL,NULL );
   gtk_window_set_title( GTK_WINDOW(hWnd), cTitle );
   g_free( cTitle );
   gtk_window_set_policy( GTK_WINDOW(hWnd), TRUE, TRUE, FALSE );
   gtk_window_set_default_size( GTK_WINDOW(hWnd), width, height );
   gtk_window_move( GTK_WINDOW(hWnd), x, y );

   vbox = gtk_vbox_new (FALSE, 0);
   gtk_container_add (GTK_CONTAINER(hWnd), vbox);
   if (bStatus)
   {
   statusbar = gtk_statusbar_new();
  box = (GtkFixed*)gtk_fixed_new();
   gtk_box_pack_start( GTK_BOX (vbox), (GtkWidget*)statusbar, FALSE, FALSE, 
0);
   gtk_box_reorder_child(GTK_BOX(vbox) statusbar,9999);
   }
   else
   {
      box = (GtkFixed*)gtk_fixed_new();
   gtk_box_pack_end( GTK_BOX(vbox), (GtkWidget*)box, TRUE, TRUE, 0 );

   }

   g_object_set_data( (GObject*) hWnd, "fbox", (gpointer) box );
   g_object_set_data( (GObject*) hWnd, "vbox", (gpointer) vbox );
   all_signal_connect( G_OBJECT (hWnd) );
   g_signal_connect_after( box, "size-allocate", G_CALLBACK 
(cb_signal_size), NULL );
   set_event( (gpointer)hWnd, "configure_event", 0, 0, 0 );

}

Regards
Luiz



_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux