翻译:GtkPaned 的说明

原创
2018/03/13 10:15
阅读数 297

Description GtkPaned has two panes, arranged either horizontally or vertically. The division between the two panes is adjustable by the user by dragging a handle.

Gtkpaned空间包含两个窗格,水平或者垂直方向(上下或者左右)排列。窗格间的边界可以由用户拖动句柄调整。

Child widgets are added to the panes of the widget with gtk_paned_pack1() and gtk_paned_pack2(). The division between the two children is set by default from the size requests of the children, but it can be adjusted by the user.

使用gtk_paned_pack1() 和 gtk_paned_pack2()为窗格添加子构件。默认两个子构建之间的分割是根据组件大小设置的,用户也可以调整。

A paned widget draws a separator between the two child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator. (The space in which the separator is called the gutter.) Often, it is useful to put each child inside a GtkFrame with the shadow type set to GTK_SHADOW_IN so that the gutter appears as a ridge. No separator is drawn if one of the children is missing.

Paned构件会绘制一个分割和一个可拖的句柄。它不会绘制轮廓(分割中的空间叫gutter)。经常把child放进GtkFrame、同时设置GtkFrame的shadow type 为GTK_SHADOW_IN、这样gutter的样式是ridge山脊。 如果只有一个子构件就不会绘制分割。

Each child has two options that can be set, resize and shrink . If resize is true, then when the GtkPaned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then that child can be made smaller than its requisition by the user. Setting shrink to FALSE allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children. The application can set the position of the slider as if it were set by the user, by calling gtk_paned_set_position().

每个子构件有两个选项:resize、shrink。 resize为true时,GtkPaned改变大小时,子组件会随之扩展收缩。shrink为true时,子组件可以比用户设定的更小。shrink为false时允许设定一个最小值。两个子组件的resize都是false等同于都是true。 应用程序可以通过gtk_paned_set_position()设定滑块的位置。

展开阅读全文
加载中
点击加入讨论🔥(1) 发布并加入讨论🔥
打赏
1 评论
0 收藏
0
分享
返回顶部
顶部