In C, to obtain the actual size of the widget: widget->allocation.{width,height} To set the size (minimum size): gtk_widget_set_size_request Example: static void _label_size_allocate(GtkWidget *a_widget, GtkAllocation *a_alloc, gpointer a_data) { printf("size %d %d\n", a_widget->allocation.width, a_widget->allocation.height); } int main(int a_argc,char **a_argv) { GtkWidget *l_label; GtkWidget *l_window; gtk_init(&a_argc,&a_argv); l_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); l_label = gtk_label_new("hello"); gtk_widget_set_size_request(GTK_WIDGET(l_label),800,600); // To see de changes with manual resize. g_signal_connect(G_OBJECT(l_label), "size-allocate", G_CALLBACK(_label_size_allocate), NULL); gtk_container_add(GTK_CONTAINER(l_window),l_label); gtk_widget_show_all(l_window); gtk_main(); return 0; } gtk_widget_size_allocate doesn't work for me. Atentamente, Jorge Opaso Pazos AUTOLogic LTDA El 07-08-2009, a las 9:21, cbx escribió: I tried:in Python,it is gtk.Label.size_request().However, it only return the size the widget request to draw itself.If you resize the window,which in turn resizes the label,the value gtk.Label.size_request() returns doesn't change. |