Reputation: 4509
I've got problems with gtk scale. I've got fixed widget where I placed horizontal scale. The problem is that the scale is very small and I don't know how to resize it to for example 100 pixels. Below is my code:
wind = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(wind), 300, 300);
fixed = gtk_fixed_new();
gtk_container_add(GTK_CONTAINER(wind), fixed);
button = gtk_button_new_with_label("button1");
gtk_fixed_put(GTK_FIXED(fixed), button, 10, 20);
button2 = gtk_button_new_with_label("button2");
gtk_fixed_put(GTK_FIXED(fixed), button2, 200, 20);
scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
gtk_fixed_put(GTK_FIXED(fixed), scale, 100, 40);
and here is how it looks like:
The scale is in the middle of the window and shows 0 value.
Upvotes: 1
Views: 2559
Reputation: 4509
Ok, I found the solution by myself:
g_object_set(scale, "width-request", 200, NULL);
Upvotes: 1