Resize gtk.Paned handle

gtk.Paned contains a style property called "descriptor size" that I suppose will change the size of the descriptor, it is read-only, so how can I change it? (in PyGtk)

+4
source share
2 answers

From the documentation for gtk.Widget :

gtk.Widget introduces style properties - these are basically object properties that are not stored on the object, but in the style object associated with the widgets. Style properties are set in resource files . This mechanism is used for the thing, since the location of the scroll bar shoots the topic, giving theme authors more control over the appearance of applications without having to write a theme engine in C.

The general practice of GTK is not to set style properties from your program, but simply to use standard user interface widgets and let the user decide how they should look (using the desktop theme).

+3
source

You can submit a custom resource file before starting your own application. In C (hopefully python translation is simple) which would be as follows:

 #include <gtk/gtk.h> int main(gint argc, gchar **argv) { GtkWidget *window; GtkPaned *paned; gtk_init(&argc, &argv); gtk_rc_parse_string("style 'my_style' {\n" " GtkPaned::handle-size = 200\n" " }\n" "widget '*' style 'my_style'"); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); paned = (GtkPaned *) gtk_hpaned_new(); gtk_paned_add1(paned, gtk_label_new("left")); gtk_paned_add2(paned, gtk_label_new("right")); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(paned)); gtk_widget_show_all(window); gtk_main(); return 0; } 
+2
source

All Articles