Re: [gtk-list] gtk_container_border_width
- From: Owen Taylor <owt1 cornell edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] gtk_container_border_width
- Date: 20 Sep 1997 13:26:07 -0400
David Abilleira <odaf@nexo.es> writes:
> ----- Cut ----
> This next function is used to set an attribute of a container object.
> This just sets the window so it has a blank area
> along the inside of it 10 pixels wide where no widgets will go. There
> are other similar functions which we will
> look at in the section on Setting Widget Attributes
>
> And again, GTK_CONTAINER is a macro to perform type casting.
>
> gtk_container_border_width (GTK_CONTAINER (window), 10);
> ----- Cut ----
>
> But when I try it, space is left out around the object, and not
> inside.
> Do I must call gtk_container_border_width for every object in a
> container, or make a box and place the object inside it?
> Thanks.
I'm not quite sure what you are trying to do ...
If a container doesn't display any border decorations (hbox, table, ...)
then there isn't a difference.
All containers that display border decorations only take one child
(button, frame).
* If the child is a container, call gtk_container_border_width on
that child.
* If the child is a misc widget (label, pixmap, arrow), then call
gtk_misc_set_padding(misc, xpad, ypad). For a button created with
gtk_button_new_with_label, it is probablt acceptable to do
gtk_misc_set_padding(GTK_MISC(GTK_BIN(button)->child), xpad, ypad);
though it might be cleaner to do it in one step.
* If the child is something else (preview...), then you'll have to
put it inside an auxilliary container (e.g., a box) and call
container_border_width on the auxilliary container.
Hope this helps,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]