GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Dec 01, 2015 2:41 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: GtkFlowBox limits window size too much
PostPosted: Mon Sep 07, 2015 7:08 pm 

Joined: Mon Sep 07, 2015 5:23 pm
Posts: 1
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 160 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);
  return vdp_doc;

Thanks in advance :)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot] and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group