Re: gtk_table_attach api, GtkAttachOptions usage



Hello.

First of all, cross-posting is bad and tends to annoy people. Stick to
your original post.

Iam trying to use gtk_table_attach api. I have issues using
xoptions(GtkAttachOptions) and yoptions in this api.
Iam not able to understand how I can use EXPAND, SHRINK and FILL options.
I tried to write a program that does the following:

1. create a table using gtk_table_new api
2. Attach a button to the table using gtk_table_attach api with this expand
option
3. Then resized the table.

Iam expecting the button be resized in the window since the table is
re-sized.
Can you please provide me a input on how the GtkAttachOptions Âbe used from
the application point of view.

GtkAttachOptions is enumeration of bitfield flags. These flags can be
added together using bitwise or. And as David already said, you
probably missed GTK_FILL flag in your gtk_table_attach() call.

For example, this call:

gtk_table_attach( table, child, 0, 1, 0, 1,
                  GTK_FILL | GTK_EXPAND, GTK_EXPAND, 0, 0 );

will cause widget to expand horizontally when table is resized.
Vertically, widget will stay of the same size, only distance to other
widgets will increase.

Tadej


-- 
Tadej BorovÅak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com



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