Re: Something simple I can't do



Hi, I'm not really understanding your problem, but it probably has
something to do with how you're calling the attach() functions.

For example, you're putting cmdOne at position (1;1), but this starts
at zero (you want to put at the top left?...)

How do you want to position the elements?

(btw, you don't need to use 'new', you can just declare a normal
variable -- and you're not deleting it :p)

On Sun, Feb 5, 2012 at 5:57 PM, yasser greyeb <yasser greyeb gmail com> wrote:
> Hi,
> I'm haven't been able to make the widgets contained in a Gtk::Grid adjust
> their size and spacing when the Grid's size change. I read it is a matter of
> widgets' expand and margin property and yet I can't make it work. When the
> Grid is resized a blank space appears where I want widgets to be.
> I have this code:
> Gtk::Main kit(argc, argv);
>
> Gtk::Window* main_win = new Gtk::Window (Gtk::WINDOW_TOPLEVEL);
> main_win->set_title ("example");
>
> Gtk::Grid grdMain;
> Gtk::Button* cmdOne = new Gtk::Button("1", true);
> Gtk::Button* cmdTwo = new Gtk::Button("2", true);
> Gtk::Button* cmdThree = new Gtk::Button("3", true);
>
> grdMain.attach (*cmdOne, 1, 1, 1, 1);
> grdMain.attach_next_to (*cmdTwo, *cmdOne, Gtk::POS_BOTTOM, 1, 1);
> grdMain.attach_next_to (*cmdThree, *cmdOne, Gtk::POS_RIGHT, 1, 2);
>
> main_win->add(grdMain);
> main_win->show_all_children ();
>
> kit.run(*main_win);
>
> I've tried changing property_margin and property_expand for all the button
> inside the Grid but doing it hasn't solved anything.
>
> What I want is the Buttons to fill all the space inside the window. Thank
> you for your help.
> Btw, sorry for my english, I speak spanish very well :P
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]