[gtkmm-documentation] Added InfoBar section.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Added InfoBar section.
- Date: Mon, 28 Sep 2009 14:41:24 +0000 (UTC)
commit 0061125b16e3210312ef023872d76223843e25b5
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Sep 28 15:21:18 2009 +0200
Added InfoBar section.
* docs/tutorial/C/figures/infobar.png: Added.
* docs/tutorial/C/gtkmm-tutorial-in.xml: Miscellaneous Widgets:
Added an InfoBar sub-section, mostly just to mention the new example.
ChangeLog | 8 ++++++++
docs/tutorial/C/figures/infobar.png | Bin 0 -> 4347 bytes
docs/tutorial/C/gtkmm-tutorial-in.xml | 24 ++++++++++++++++++++++++
docs/tutorial/Makefile.am | 1 +
examples/book/infobar/examplewindow.cc | 15 +++++++--------
5 files changed, 40 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c592cc7..028f582 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-09-28 Murray Cumming <murrayc murrayc com>
+ Added InfoBar section.
+
+ * docs/tutorial/C/figures/infobar.png: Added.
+ * docs/tutorial/C/gtkmm-tutorial-in.xml: Miscellaneous Widgets:
+ Added an InfoBar sub-section, mostly just to mention the new example.
+
+2009-09-28 Murray Cumming <murrayc murrayc com>
+
Examples: Do not use virtual on all methods.
* examples/*.h: Removed unnecessary virtual keywords. I once thought
diff --git a/docs/tutorial/C/figures/infobar.png b/docs/tutorial/C/figures/infobar.png
new file mode 100644
index 0000000..5687e19
Binary files /dev/null and b/docs/tutorial/C/figures/infobar.png differ
diff --git a/docs/tutorial/C/gtkmm-tutorial-in.xml b/docs/tutorial/C/gtkmm-tutorial-in.xml
index e8cdd95..b84f954 100644
--- a/docs/tutorial/C/gtkmm-tutorial-in.xml
+++ b/docs/tutorial/C/gtkmm-tutorial-in.xml
@@ -1492,6 +1492,30 @@ string within its trough, using the <methodname>set_text()</methodname> method.
</sect1>
+
+<sect1 id="sec-infobar">
+<title>InfoBar</title>
+
+<para>
+An <classname>InfoBar</classname> may be used to show small items of information or to ask brief questions. Unlike a <classname>Dialog</classname>, it appears at the top of the current window instead of opening a new window. Its API is very similar to the <link linkend="chapter-dialogs">Gtk::Dialog</link> API.</para>
+
+<para><ulink url="&url_refdocs_base_gtk;InfoBar.html">Reference</ulink></para>
+
+<sect2 id="infobar-example"><title>Example</title>
+
+<figure id="figure-infobar">
+ <title>InfoBar</title>
+ <screenshot>
+ <graphic format="PNG" fileref="&url_figures_base;infobar.png"/>
+ </screenshot>
+</figure>
+
+<para><ulink url="&url_examples_base;infobar">Source Code</ulink></para>
+
+</sect2>
+
+</sect1>
+
<sect1 id="sec-tooltips">
<title>Tooltips</title>
diff --git a/docs/tutorial/Makefile.am b/docs/tutorial/Makefile.am
index 3fc8f36..9f20f18 100644
--- a/docs/tutorial/Makefile.am
+++ b/docs/tutorial/Makefile.am
@@ -56,6 +56,7 @@ DOC_FIGURES = \
figures/helloworld.png \
figures/helloworld2.png \
figures/idle.png \
+ figures/infobar.png \
figures/label.png \
figures/main_menu.png \
figures/menu_popup.png \
diff --git a/examples/book/infobar/examplewindow.cc b/examples/book/infobar/examplewindow.cc
index 1232ce5..2e754c8 100644
--- a/examples/book/infobar/examplewindow.cc
+++ b/examples/book/infobar/examplewindow.cc
@@ -17,16 +17,17 @@
#include "examplewindow.h"
ExampleWindow::ExampleWindow()
-: m_Button_Quit(Gtk::Stock::QUIT),
+: m_VBox(false, 6),
+ m_Button_Quit(Gtk::Stock::QUIT),
m_Button_Clear("Clear")
{
set_title("Gtk::InfoBar example");
- set_border_width(5);
+ set_border_width(6);
set_default_size(400, 200);
add(m_VBox);
- // Create the buffer and set it on the TextView:
+ // Create the buffer and set it for the TextView:
m_refTextBuffer = Gtk::TextBuffer::create();
m_TextView.set_buffer(m_refTextBuffer);
@@ -43,14 +44,12 @@ ExampleWindow::ExampleWindow()
m_ButtonBox.pack_start(m_Button_Clear, Gtk::PACK_SHRINK);
m_ButtonBox.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
- m_ButtonBox.set_border_width(5);
- m_ButtonBox.set_spacing(5);
+ m_ButtonBox.set_spacing(6);
m_ButtonBox.set_layout(Gtk::BUTTONBOX_END);
// Add the message label to the InfoBar:
Gtk::Container* infoBarContainer =
- static_cast<Gtk::Container*>(m_InfoBar.get_content_area());
-
+ dynamic_cast<Gtk::Container*>(m_InfoBar.get_content_area());
if (infoBarContainer)
infoBarContainer->add(m_Message_Label);
@@ -94,7 +93,7 @@ void ExampleWindow::on_button_quit()
void ExampleWindow::on_button_clear()
{
m_refTextBuffer->set_text("");
- m_Message_Label.set_text("Cleared the TextBuffer.");
+ m_Message_Label.set_text("Cleared the text.");
m_InfoBar.set_message_type(Gtk::MESSAGE_INFO);
m_InfoBar.show();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]