GTK v1.2 Tutorial(英文) |
10.2 The Alignment widget
The alignment widget allows you to place a widget within its window at a position and size relative to the size of the Alignment widget itself. For example, it can be very useful for centering a widget within the window.
There are only two functions associated with the Alignment widget:
|
The first function creates a new Alignment widget with the specified parameters. The second function allows the alignment paramters of an exisiting Alignment widget to be altered.
All four alignment parameters are floating point numbers which can range from 0.0 to 1.0. The xalign and yalign arguments affect the position of the widget placed within the Alignment widget. The xscale and yscale arguments effect the amount of space allocated to the widget.
A child widget can be added to this Alignment widget using:
|
For an example of using an Alignment widget, refer to the example for the Progress Bar widget.
10.3 Fixed Container
The Fixed container allows you to place widgets at a fixed position within it's window, relative to it's upper left hand corner. The position of the widgets can be changed dynamically.
There are only three functions associated with the fixed widget:
|
The function gtk_fixed_new allows you to create a new Fixed container.
gtk_fixed_put places widget in the container fixed at the position specified by x and y.
gtk_fixed_move allows the specified widget to be moved to a new position.
The following example illustrates how to use the Fixed Container.
上一篇:GTK入门导引 下一篇:GDK Reference Manual 更多相关文章
|
推荐文章
精彩文章
|