[gtkmm-documentation] InfoBar Example: Move the bar to the top of the window.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] InfoBar Example: Move the bar to the top of the window.
- Date: Mon, 5 Oct 2009 21:08:07 +0000 (UTC)
commit 2844872f5e044789f8d556ab54054d8ad7024603
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Mon Oct 5 16:48:26 2009 -0400
InfoBar Example: Move the bar to the top of the window.
* examples/book/infobar/examplewindow.cc:
* examples/book/infobar/examplewindow.h: Modify the example to show
the info bar at the top of the window for consistency with the
tutorial.
* docs/tutorial/C/figures/infobar.png: Upload a new image using the
clearlooks theme for consistency with the rest of the figures in the
tutorial (I hope that's okay).
ChangeLog | 12 +++++++++
docs/tutorial/C/figures/infobar.png | Bin 4347 -> 10101 bytes
examples/book/infobar/examplewindow.cc | 43 +++++++++++++++----------------
examples/book/infobar/examplewindow.h | 8 +++---
4 files changed, 37 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index da4bff2..de5bbdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-05 José Alburquerque <jaalburqu svn gnome org>
+
+ InfoBar Example: Move the bar to the top of the window.
+
+ * examples/book/infobar/examplewindow.cc:
+ * examples/book/infobar/examplewindow.h: Modify the example to show
+ the info bar at the top of the window for consistency with the
+ tutorial.
+ * docs/tutorial/C/figures/infobar.png: Upload a new image using the
+ clearlooks theme for consistency with the rest of the figures in the
+ tutorial (I hope that's okay).
+
2009-10-03 Daniel Elstner <daniel kitta gmail com>
Support Automake silent rules
diff --git a/docs/tutorial/C/figures/infobar.png b/docs/tutorial/C/figures/infobar.png
index 5687e19..0750ef1 100644
Binary files a/docs/tutorial/C/figures/infobar.png and b/docs/tutorial/C/figures/infobar.png differ
diff --git a/examples/book/infobar/examplewindow.cc b/examples/book/infobar/examplewindow.cc
index 2e754c8..31688aa 100644
--- a/examples/book/infobar/examplewindow.cc
+++ b/examples/book/infobar/examplewindow.cc
@@ -27,6 +27,18 @@ ExampleWindow::ExampleWindow()
add(m_VBox);
+ // Add the message label to the InfoBar:
+ Gtk::Container* infoBarContainer =
+ dynamic_cast<Gtk::Container*>(m_InfoBar.get_content_area());
+ if (infoBarContainer)
+ infoBarContainer->add(m_Message_Label);
+
+ // Add an ok button to the InfoBar:
+ m_InfoBar.add_button(Gtk::Stock::OK, 0);
+
+ // Add the InfoBar to the vbox:
+ m_VBox.pack_start(m_InfoBar, Gtk::PACK_SHRINK);
+
// Create the buffer and set it for the TextView:
m_refTextBuffer = Gtk::TextBuffer::create();
m_TextView.set_buffer(m_refTextBuffer);
@@ -47,28 +59,15 @@ ExampleWindow::ExampleWindow()
m_ButtonBox.set_spacing(6);
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
- // Add the message label to the InfoBar:
- Gtk::Container* infoBarContainer =
- dynamic_cast<Gtk::Container*>(m_InfoBar.get_content_area());
- if (infoBarContainer)
- infoBarContainer->add(m_Message_Label);
-
-
- // Add an ok button to the InfoBar:
- m_InfoBar.add_button(Gtk::Stock::OK, 0);
-
- // Add the InfoBar:
- m_VBox.pack_start(m_InfoBar, Gtk::PACK_SHRINK);
-
// Connect signals:
+ m_InfoBar.signal_response().connect(sigc::mem_fun(*this,
+ &ExampleWindow::on_infobar_response) );
m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_quit) );
m_Button_Clear.signal_clicked().connect(sigc::mem_fun(*this,
&ExampleWindow::on_button_clear) );
m_refTextBuffer->signal_changed().connect(sigc::mem_fun(*this,
&ExampleWindow::on_textbuffer_changed) );
- m_InfoBar.signal_response().connect(sigc::mem_fun(*this,
- &ExampleWindow::on_infobar_response) );
show_all_children();
@@ -85,6 +84,13 @@ ExampleWindow::~ExampleWindow()
{
}
+void ExampleWindow::on_infobar_response(int)
+{
+ // Clear the message and hide the info bar:
+ m_Message_Label.set_text("");
+ m_InfoBar.hide();
+}
+
void ExampleWindow::on_button_quit()
{
hide();
@@ -102,10 +108,3 @@ void ExampleWindow::on_textbuffer_changed()
{
m_Button_Clear.set_sensitive(m_refTextBuffer->size() > 0);
}
-
-void ExampleWindow::on_infobar_response(int)
-{
- // Clear the message and hide the info bar:
- m_Message_Label.set_text("");
- m_InfoBar.hide();
-}
diff --git a/examples/book/infobar/examplewindow.h b/examples/book/infobar/examplewindow.h
index ffb3aa2..f0c53c5 100644
--- a/examples/book/infobar/examplewindow.h
+++ b/examples/book/infobar/examplewindow.h
@@ -27,10 +27,10 @@ public:
protected:
//Signal handlers:
+ void on_infobar_response(int response);
void on_button_quit();
void on_button_clear();
void on_textbuffer_changed();
- void on_infobar_response(int response);
//Child widgets:
Gtk::VBox m_VBox;
@@ -40,11 +40,11 @@ protected:
Glib::RefPtr<Gtk::TextBuffer> m_refTextBuffer;
- Gtk::HButtonBox m_ButtonBox;
- Gtk::Button m_Button_Quit, m_Button_Clear;
-
Gtk::InfoBar m_InfoBar;
Gtk::Label m_Message_Label;
+
+ Gtk::HButtonBox m_ButtonBox;
+ Gtk::Button m_Button_Quit, m_Button_Clear;
};
#endif //GTKMM_EXAMPLEWINDOW_H
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]