学习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_ALWAYS。Gtk::POLICY_AUTOMATIC 设置滚动条在子控件的大小超出显示区域时显示, Gtk::POLICY_ALWAYS设置滚动条总是显示。
§ 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个开关按钮的简单例子。试着改变窗口的大小看滚动条的反应。