ScrolledWindow

学习gtkmm有几周了,英语太烂了,硬着头皮边看边记,还没把握,发上来,大家斧正

7.1.3. ScrolledWindow

ScrolledWindow widgets create a scrollable area. You can insert any type of widget into a ScrolledWindow window, and it will be accessible regardless of its size by using the scrollbars. Note that ScrolledWindow is not a Gtk::Window despite the slightly misleading name.

滚动窗口(ScrolledWindow控件建立一个滚动区。你可以在滚动窗口中插入任何类型控件,借助滚动条访问,不受大小限制。注意,虽然叫ScrolledWindow,但它不是一个Gtk::window

Scrolled windows have scrollbar policies which determine whether the Scrollbars will be displayed. The policies can be set with the set_policy() method. The policy may be one of Gtk::POLICY_AUTOMATIC or Gtk::POLICY_ALWAYS. Gtk::POLICY_AUTOMATIC will cause the scrolled window to display the scrollbar only if the contained widget is larger than the visible area. Gtk::POLICY_ALWAYS will cause the scrollbar to be displayed always.

滚动窗口(ScrolledWindow)有一定的显示滚动条(Scrollbars)的方式。显示方式可由set_policy()方法设置。设置值可为Gtk::POLICY_AUTOMATIC Gtk::POLICY_ALWAYSGtk::POLICY_AUTOMATIC 设置滚动条在子控件的大小超出显示区域时显示, Gtk::POLICY_ALWAYS设置滚动条总是显示。

参考

§  7.1.3.1. 示例

7.1.3.1. 示例

Here is a simple example that packs 100 toggle buttons into a ScrolledWindow. Try resizing the window to see the scrollbars react.

这里是一个在滚动窗中放入100个开关按钮的简单例子。试着改变窗口的大小看滚动条的反应。

7-3 ScrolledWindow

源代码

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值