⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk.texi

📁 gtk是linux一款强大的夸平台的图形化开发工具
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
widget should expand and position itself to fill the area it isallocated.@subsection Options@defopt xscale@defoptx yscaleThe @var{xscale} and @var{yscale} options specify how to scale the childwidget. If the scale value is 0.0, the child widget is allocated exactlythe size it requested in that dimension. If the scale value is 1.0, thechild widget is allocated all of the space in a dimension. A scale valueof 1.0 for both x and y is equivalent to not using an alignment widget.@end defopt@defopt xalign@defoptx yalignThe @var{xalign} and @var{yalign} options specify how to position thechild widget when it is not allocated all the space available to it(because the @var{xscale} and/or @var{yscale} options are less than1.0). If an alignment value is 0.0 the widget is positioned to the left(or top) of its allocated space. An alignment value of 1.0 positions thewidget to the right (or bottom) of its allocated space. A common usageis to specify @var{xalign} and @var{yalign} to be 0.5 which causes thewidget to be centered within its allocated area.@end defopt@subsection Signals@subsection Functions@deftypefun guint gtk_alignment_get_type (void)Returns the @code{GtkAlignment} type identifier.@end deftypefun@deftypefun GtkWidget* gtk_alignment_new (gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{xscale}, gfloat @var{yscale})Create a new @code{GtkAlignment} object and initialize it with thevalues @var{xalign}, @var{yalign}, @var{xscale} and @var{yscale}. Thenew widget is returned as a pointer to a @code{GtkWidget}object. @code{NULL} is returned on failure.@end deftypefun@deftypefun void gtk_alignment_set (GtkAlignment *@var{alignment}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{xscale}, gfloat @var{yscale})Set the @var{xalign}, @var{yalign}, @var{xscale} and @var{yscale} optionsof an alignment widget. It is important to not set the fields of the@code{GtkAlignment} structure directly (or, for that matter, any typederived from @code{GtkObject}).@end deftypefun@gtkstdmacros{Alignment, ALIGNMENT}@page@node GtkArrow, GtkAspectFrame, GtkAlignment, Widgets@comment node-name, next, previous, up@section The arrow widget@subsection DescriptionThe arrow widget is derived from the misc widget (@pxref{GtkMisc}) andis intended for use where a directional arrow (in one of the fourcardinal directions) is desired. As such, it has very limitedfunctionality and basically only draws itself in a particular directionand with a particular shadow type. The arrow widget will expand to fillall the space it is allocated.@subsection Options@defopt arrow_typeThe @var{arrow_type} option specifies which direction the arrow willpoint. It can be one of @code{GTK_ARROW_UP}, @code{GTK_ARROW_DOWN},@code{GTK_ARROW_LEFT} or @code{GTK_ARROW_RIGHT}. This will set the arrowpointing in the direction specified.@end defopt@defopt shadow_typeThe @var{shadow_type} option specifies how to draw the shadow for thearrow. Currently, only the @code{GTK_SHADOW_IN} and@code{GTK_SHADOW_OUT} shadow types are supported for drawingarrows. Other shadow types will cause nothing to be drawn.@end defopt@subsection Signals@subsection Functions@deftypefun guint gtk_arrow_get_type (void)Returns the @code{GtkArrow} type identifier.@end deftypefun@deftypefun GtkWidget* gtk_arrow_new (GtkArrowType @var{arrow_type}, GtkShadowType @var{shadow_type})Create a new @code{GtkArrow} object and initialize it with the values@var{arrow_type} and @var{shadow_type}. The new widget is returned as apointer to a @code{GtkWidget} object. @code{NULL} is returned onfailure.@end deftypefun@deftypefun void gtk_arrow_set (GtkArrow *@var{arrow}, GtkArrowType @var{arrow_type}, GtkShadowType @var{shadow_type})Set the @var{arrow_type} and @var{shadow_type} options of an arrowwidget. It is important to not set the fields of the @code{GtkArrow}structure directly (or, for that matter, any type derived from@code{GtkObject}).@end deftypefun@gtkstdmacros{Arrow, ARROW}@page@node GtkAspectFrame, GtkBin, GtkArrow, Widgets@comment node-name, next, previous, upa@section The aspect frame widget@subsection DescriptionEnsure that the child window has a specified aspect ratio or, ifobey_child, has the same aspect ratio as its requested size.  Derivedfrom @pxref{GtkFrame}).@subsection Options@defopt label@end defopt@defopt xalign@end defopt@defopt yalign@end defopt@defopt ratio@end defopt@defopt obey_child@end defopt@subsection Signals@subsection Functions@deftypefun guint gtk_aspect_frame_get_type (void)Returns the @code{GtkAspectFrame} type identifier.@end deftypefun@deftypefun GtkWidget* gtk_aspect_frame_new (gchar *@var{label}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{ratio}, gint @var{obey_child})Create a new @code{GtkAspectFrame} object and initialize it with the values @var{label}, @var{xalign}, @var{yalign}, @var{ratio} and @var{obey_child}.The new widget is returned as a pointer to a @code{GtkWidget} object. @code{NULL} is returned on failure.@end deftypefun@deftypefun void gtk_aspect_frame_set (GtkAspectFrame *@var{aspect_frame}, gfloat @var{xalign}, gfloat @var{yalign}, gfloat @var{ratio}, gint @var{obey_child})@end deftypefun@gtkstdmacros{AspectFrame, ASPECT_FRAME}@page@node GtkBin, GtkBox, GtkAspectFrame, Widgets@comment node-name, next, previous, up@section The bin widget@subsection DescriptionThe bin widget is a container (@pxref{GtkContainer}) derived from thecontainer widget. It is an abstract base class. That is, it is notpossible to create an actual bin widget. It exists only to provide abase of functionality for other widgets. Specifically, the bin widgetprovides a base for several other widgets that contain only a singlechild. These widgets include alignments (@pxref{GtkAlignment}), frames(@pxref{GtkFrame}), items (@pxref{GtkItem}), viewports(@pxref{GtkViewport}) and windows (@pxref{GtkWindow})@subsection Options@subsection Signals@subsection Functions@deftypefun guint gtk_bin_get_type (void)Returns the @code{GtkBin} type identifier.@end deftypefun@gtkstdmacros{Bin, BIN}@page@node GtkBox, GtkButtonBox, GtkBin, Widgets@comment node-name, next, previous, up@section The box widget@subsection DescriptionThe box widget is a container (@pxref{GtkContainer}) derived from thecontainer widget. It is an abstract base class used by the horizontalbox (@pxref{GtkHBox}), the vertical box (@pxref{GtkVBox}) and the (@pxref{GtkButtonBox}) widgets to provide a base of common functionality.A box provides an abstraction for organizing the position and size ofwidgets. Widgets in a box are laid out horizontally or vertically. Byusing a box widget appropriately, a programmer can control how widgetsare positioned and how they will be allocated space when a window getsresized.The key attribute of boxes is that they position their children in asingle row (horizontal boxes) or column (vertical boxes). In the case ofhorizontal boxes, all children are stretched vertically. The verticalsize of the box is determined by the largest vertical requisition of allof its children. Similarly, a vertical box stretches all of its childrenhorizontally. The horizontal size (of the vertical box) is determined bythe largest horizontal requisition of all of its children. An alignmentwidget (@pxref{GtkAlignment}) can be used to control child allocationmore precisely on a per child basis.The second attribute of boxes is how they expand children. In the caseof a horizontal box, the main control is over how children are expandedhorizontally to fill the allocated area. (The rest of this discussionwill focus on horizontal boxes but it applies to vertical boxes aswell).There are two flags which can be set controlling how a widget isexpanded horizontally in a horizontal box. These are the @code{expand}and @code{fill}. There operation is fairly simple. If @code{expand} isset, the child's potentially allocated area will expand to fill availablespace. If @code{fill} is set, the child's actual allocated area will beits potentially allocated area. There is a difference betweenthe potentially area (which is the area the box widget sets aside forthe child) and the actual allocated area (which is the area the boxwidget actual allocates for the widget via@code{gtk_widget_size_allocate}).The allocation of space to children occurs as follows (for horizontalboxes):@enumerate@itemAll children are allocated at least their requested size horizontallyand the maximum requested child size vertically.@itemAny child with the @code{expand} flag set is allocated @code{extra_width/ nexpand_children} extra pixels horizontally. If the @code{homogeneous}flag was set, all children are considered to have the @code{expand} flagset. That is, all children will be allocated the same area.Thehorizontal box is a fair widget and, as such, divides up any extraallocated space evenly among the ``expand'' children. (Those childrenwhich have the @code{expand} flag set). The exception occurs when@code{extra_width / nexpand_children} does not divide cleanly. The extraspace is given to the last widget.@item@code{spacing} number of pixels separate each child. Note: Theseparation is between the potentially allocated area for each child andnot the actual allocated area. The @code{padding} value associated witheach child causes that many pixels to be left empty to each side of thechild.@itemIf a child has the @code{fill} flag set it is allocated its potentiallyallocated area. If it does not, it is allocated its requested sizehorizontally and centered within its potentially allocated area. Itsvertical allocation is still the maximum requested size of any child.@itemChildren placed at the start of the box are placed in order of additionto the box from left to right in the boxes allocated area.. Childrenplaced at the end of the box are placed in order of addition from rightto left in the boxes allocated area.@end enumerate@xref{GtkHBox}, and @ref{GtkVBox}, for code examples of using horizontaland vertical boxes.@subsection Options@defopt expand@end defopt@defopt fill@end defopt@defopt padding@end defopt@defopt expand@end defopt@c FIXME: options for GtkBox@subsection Signals@subsection Functions@deftypefun guint gtk_box_get_type (void)Returns the @code{GtkBox} type identifier.@end deftypefun@deftypefun void gtk_box_pack_start (GtkBox *@var{box}, GtkWidget *@var{child}, gint @var{expand}, gint @var{fill}, gint @var{padding})Add @var{child} to the front of @var{box}. The flags @var{expand} and@var{fill} and the padding value of @var{padding} are associated with@var{child}.@end deftypefun@deftypefun void gtk_box_pack_en

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -