Hey all, I'm learning Gtk+ version 3.16.6 in C right now. I created a GtkFlowBox with 10 GtkButtons inside.
upload_to_forum.jpg [ 37.19 KiB | Viewed 62 times ]
The flow box works as expected when I expand the window horizontally, but I can't figure out how to make the buttons align to the top.
The window also refuses to shrink vertically when it has room, which is not behaviour I want(The gimp toolbox is the behaviour I am going for).
I cannot figure out how to make it work this way, so please help.
here is the relevant code:
VdpDoc *vdp_doc_new (GtkWidget *window)
VdpDoc *vdp_doc = malloc (sizeof(VdpDoc));
vdp_doc->window = window;
GtkWidget *button_container = gtk_flow_box_new ();
gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (button_container), 255);
gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (button_container), GTK_SELECTION_NONE);
for (unsigned int i = 0;i < 10; i++)
// will be replaced with icons
GtkWidget *button = gtk_button_new_with_label ("n");
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_flow_box_insert (GTK_FLOW_BOX (button_container),button,-1);
gtk_container_add (GTK_CONTAINER (vdp_doc->window), button_container);
vdp_docs = g_slist_append (vdp_docs, vdp_doc);
Thanks in advance :)