[gtkmm-documentation] Range Widgets example: Fix size and orientation of widgets.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Range Widgets example: Fix size and orientation of widgets.
- Date: Tue, 6 Sep 2011 17:03:48 +0000 (UTC)
commit 0dfdc2f0b08faf57fa49e71ba367bba327ea5ddb
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Tue Sep 6 18:47:31 2011 +0200
Range Widgets example: Fix size and orientation of widgets.
* examples/book/range_widgets/examplewindow.cc: Fix the orientation of some
boxes and the size of the vertical scale widget. Bug #658265.
ChangeLog | 7 +++++++
examples/book/range_widgets/examplewindow.cc | 14 ++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6cbf015..6b17f8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-06 Kjell Ahlstedt <kjell ahlstedt bredband net>
+
+ Range Widgets example: Fix size and orientation of widgets.
+
+ * examples/book/range_widgets/examplewindow.cc: Fix the orientation of some
+ boxes and the size of the vertical scale widget. Bug #658265.
+
2011-08-25 Murray Cumming <murrayc murrayc com>
Replace use of deprecated FontSelectionDialog.
diff --git a/examples/book/range_widgets/examplewindow.cc b/examples/book/range_widgets/examplewindow.cc
index a1f7b55..651da1a 100644
--- a/examples/book/range_widgets/examplewindow.cc
+++ b/examples/book/range_widgets/examplewindow.cc
@@ -21,8 +21,9 @@
ExampleWindow::ExampleWindow()
:
+ m_VBox_Top(Gtk::ORIENTATION_VERTICAL, 0),
m_VBox2(Gtk::ORIENTATION_VERTICAL, 20),
- m_VBox_HScale(Gtk::ORIENTATION_HORIZONTAL, 10),
+ m_VBox_HScale(Gtk::ORIENTATION_VERTICAL, 10),
m_HBox_Scales(Gtk::ORIENTATION_HORIZONTAL, 10),
m_HBox_Digits(Gtk::ORIENTATION_HORIZONTAL, 10),
m_HBox_PageSize(Gtk::ORIENTATION_HORIZONTAL, 10),
@@ -32,7 +33,7 @@ ExampleWindow::ExampleWindow()
// scrollbar widgets, and the highest value you'll get is actually
// (upper - page_size).
m_adjustment( Gtk::Adjustment::create(0.0, 0.0, 101.0, 0.1, 1.0, 1.0) ),
- m_adjustment_digits( Gtk::Adjustment::create(1.0, 0.0, 5.0) ),
+ m_adjustment_digits( Gtk::Adjustment::create(1.0, 0.0, 5.0, 1.0, 2.0) ),
m_adjustment_pagesize( Gtk::Adjustment::create(1.0, 1.0, 101.0) ),
m_VScale(m_adjustment, Gtk::ORIENTATION_VERTICAL),
@@ -51,17 +52,18 @@ ExampleWindow::ExampleWindow()
m_Button_Quit("Quit")
{
set_title("range controls");
+ set_default_size(300, 350);
//VScale:
m_VScale.set_digits(1);
m_VScale.set_value_pos(Gtk::POS_TOP);
m_VScale.set_draw_value();
+ m_VScale.set_inverted(); // highest value at top
//HScale:
m_HScale.set_digits(1);
m_HScale.set_value_pos(Gtk::POS_TOP);
m_HScale.set_draw_value();
- m_HScale.set_size_request(200, 30);
add(m_VBox_Top);
m_VBox_Top.pack_start(m_VBox2);
@@ -81,7 +83,7 @@ ExampleWindow::ExampleWindow()
m_CheckButton.set_active();
m_CheckButton.signal_toggled().connect( sigc::mem_fun(*this,
&ExampleWindow::on_checkbutton_toggled) );
- m_VBox2.pack_start(m_CheckButton);
+ m_VBox2.pack_start(m_CheckButton, Gtk::PACK_SHRINK);
//Menus:
Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem("Top"));
@@ -125,8 +127,8 @@ ExampleWindow::ExampleWindow()
&ExampleWindow::on_adjustment2_value_changed));
m_HBox_PageSize.pack_start(m_Scale_PageSize);
- m_VBox2.pack_start(m_HBox_Digits);
- m_VBox2.pack_start(m_HBox_PageSize);
+ m_VBox2.pack_start(m_HBox_Digits, Gtk::PACK_SHRINK);
+ m_VBox2.pack_start(m_HBox_PageSize, Gtk::PACK_SHRINK);
m_VBox_Top.pack_start(m_Separator, Gtk::PACK_SHRINK);
m_VBox_Top.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]