Packing Boxes - PowerPoint PPT Presentation

About This Presentation
Title:

Packing Boxes

Description:

To display widgets one on top of another, a vertical box is used. Packing Boxes ... Expand - allocate extra space to child widget if. box expands ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 8
Provided by: eckerdwor
Category:
Tags: boxes | child | packing | top

less

Transcript and Presenter's Notes

Title: Packing Boxes


1
Packing Boxes
2
Positioning of widgets within a window is
achieved with the use of packing boxes or tables.

To display widgets one on top of another, a
vertical box is used.
To display widgets side by side, a horizontal box
is used.
GtkWidget box box gtk_vbox_new(False, 0)
3
Homogeneous - all widgets are assigned the same
width (in a horizontal box), the same height (in
a vertical box).
Spacing - the default (minimum) number of pixels
between child widgets
HOMOGENEOUS
SPACING
GtkWidget box box gtk_vbox_new(False, 0)
4
GtkWidget box box gtk_vbox_new(False,
0) gtk_box_pack_start(GTK_BOX(box),
button1, FALSE, FALSE, 0)
5
GtkWidget box box gtk_vbox_new(False,
0) gtk_box_pack_start(GTK_BOX(box),
button1, FALSE, FALSE, 0) gtk_box_pack_start(GTK
_BOX(box), button2, FALSE, FALSE, 0)
When gtk_box_pack_start is used in a vbox,
widgets are inserted at the top of the box, any
others added at the top go below.
6
GtkWidget box box gtk_vbox_new(False,
0) gtk_box_pack_end(GTK_BOX(box),
button1, FALSE, FALSE, 0) gtk_box_pack_end(GTK_B
OX(box), button2, FALSE, FALSE, 0)
When gtk_box_pack_end is used in a vbox,
widgets are inserted at the bottom of the box,
any others added at the top go above.
7
Packing Tables allow placement of widgets in a
window using x and y coordinate values.
GtkWidget table table gtk_table_new(3, 2,
TRUE)
gtk_table_attach_defaults( GTK_TABLE(table),
button, 1,1,0,1)
Write a Comment
User Comments (0)
About PowerShow.com