gtkmm-documentation r84 - in trunk: . examples/book/entry examples/book/entry/icon examples/book/entry/progress
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtkmm-documentation r84 - in trunk: . examples/book/entry examples/book/entry/icon examples/book/entry/progress
- Date: Tue, 17 Mar 2009 12:17:38 +0000 (UTC)
Author: murrayc
Date: Tue Mar 17 12:17:38 2009
New Revision: 84
URL: http://svn.gnome.org/viewvc/gtkmm-documentation?rev=84&view=rev
Log:
2.16.0:
2009-03-17 Murray Cumming <murrayc murrayc com>
* examples/book/entry/Makefile.am:
* examples/book/entry/icon/:
* examples/book/entry/progress/: Added entry/progress and entry/icon
examples, just to test that API.
Added:
trunk/examples/book/entry/icon/ (props changed)
- copied from r83, /trunk/examples/book/entry/simple/
trunk/examples/book/entry/progress/ (props changed)
- copied from r83, /trunk/examples/book/entry/simple/
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.in
trunk/examples/book/entry/Makefile.am
trunk/examples/book/entry/icon/examplewindow.cc
trunk/examples/book/entry/icon/examplewindow.h
trunk/examples/book/entry/progress/examplewindow.cc
trunk/examples/book/entry/progress/examplewindow.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Mar 17 12:17:38 2009
@@ -1,5 +1,8 @@
-2.14.2:
+2.16.0:
+
+* Added entry/progress and entry/icon examples, just to test that API.
+2.14.2:
* gmmproc appendix: Mention pygobject instead of pygtk for the codegen stuff
such as h2def.py and docextract_to_xml.py. Noticed by Krzesimir Nowak.
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Tue Mar 17 12:17:38 2009
@@ -14,8 +14,8 @@
#We use pushdef here because we can't use shell variables before AC_INIT, but we want to use a variable with AC_INIT:
pushdef([GTKMM_DOCUMENTATION_MAJOR_VERSION], [2])
-pushdef([GTKMM_DOCUMENTATION_MINOR_VERSION], [14])
-pushdef([GTKMM_DOCUMENTATION_MICRO_VERSION], [2])
+pushdef([GTKMM_DOCUMENTATION_MINOR_VERSION], [16])
+pushdef([GTKMM_DOCUMENTATION_MICRO_VERSION], [0])
pushdef([GTKMM_DOCUMENTATION_EXTRA_VERSION], [])
pushdef([GTKMM_DOCUMENTATION_VERSION], GTKMM_DOCUMENTATION_MAJOR_VERSION.GTKMM_DOCUMENTATION_MINOR_VERSION.GTKMM_DOCUMENTATION_MICRO_VERSION[]GTKMM_DOCUMENTATION_EXTRA_VERSION)
AC_INIT([gtkmm-documentation], GTKMM_DOCUMENTATION_VERSION, [gtkmm-list gnome org])
@@ -194,7 +194,7 @@
#########################################################################
# Dependancy checks
#########################################################################
-PKG_CHECK_MODULES(GTKMMDOCS, gtkmm-2.4 >= 2.13.8 giomm-2.4 >= 2.15.2 libglademm-2.4 >= 2.6.0})
+PKG_CHECK_MODULES(GTKMMDOCS, gtkmm-2.4 >= 2.16.0 giomm-2.4 >= 2.16.0 libglademm-2.4 >= 2.6.0})
AC_SUBST(GTKMMDOCS_CFLAGS)
AC_SUBST(GTKMMDOCS_LIBS)
@@ -304,6 +304,8 @@
examples/book/drawingarea/joins/Makefile
examples/book/entry/Makefile
examples/book/entry/completion/Makefile
+ examples/book/entry/icon/Makefile
+ examples/book/entry/progress/Makefile
examples/book/entry/simple/Makefile
examples/book/eventbox/Makefile
examples/book/expander/Makefile
Modified: trunk/examples/book/entry/Makefile.am
==============================================================================
--- trunk/examples/book/entry/Makefile.am (original)
+++ trunk/examples/book/entry/Makefile.am Tue Mar 17 12:17:38 2009
@@ -1 +1 @@
-SUBDIRS = simple completion
+SUBDIRS = simple completion progress icon
Modified: trunk/examples/book/entry/icon/examplewindow.cc
==============================================================================
--- /trunk/examples/book/entry/simple/examplewindow.cc (original)
+++ trunk/examples/book/entry/icon/examplewindow.cc Tue Mar 17 12:17:38 2009
@@ -20,37 +20,23 @@
#include <iostream>
ExampleWindow::ExampleWindow()
-: m_Button_Close("Close"),
- m_CheckButton_Editable("Editable"),
- m_CheckButton_Visible("Visible")
+: m_Button_Close("Close")
{
- set_size_request(200, 100);
set_title("Gtk::Entry");
add(m_VBox);
m_Entry.set_max_length(50);
- m_Entry.set_text("hello");
- m_Entry.set_text(m_Entry.get_text() + " world");
- m_Entry.select_region(0, m_Entry.get_text_length());
- m_VBox.pack_start(m_Entry);
-
- // Note that add() can also be used instead of pack_xxx()
- m_VBox.add(m_HBox);
-
- m_HBox.pack_start(m_CheckButton_Editable);
- m_CheckButton_Editable.signal_toggled().connect( sigc::mem_fun(*this,
- &ExampleWindow::on_checkbox_editable_toggled) );
- m_CheckButton_Editable.set_active(true);
-
- m_HBox.pack_start(m_CheckButton_Visible);
- m_CheckButton_Visible.signal_toggled().connect( sigc::mem_fun(*this,
- &ExampleWindow::on_checkbox_visibility_toggled) );
- m_CheckButton_Visible.set_active(true);
+ m_Entry.set_text("Hello world");
+ m_VBox.pack_start(m_Entry, Gtk::PACK_SHRINK);
+
+ m_Entry.set_icon_from_stock(Gtk::Stock::FIND);
+ m_Entry.signal_icon_press().connect( sigc::mem_fun(*this, &ExampleWindow::on_icon_pressed) );
+
m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_close) );
- m_VBox.pack_start(m_Button_Close);
+ m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
m_Button_Close.grab_default();
@@ -61,14 +47,9 @@
{
}
-void ExampleWindow::on_checkbox_editable_toggled()
-{
- m_Entry.set_editable(m_CheckButton_Editable.get_active());
-}
-
-void ExampleWindow::on_checkbox_visibility_toggled()
+void ExampleWindow::on_icon_pressed(Gtk::EntryIconPosition /* icon_pos */, const GdkEventButton* /* event */)
{
- m_Entry.set_visibility(m_CheckButton_Visible.get_active());
+ std::cout << "Icon pressed." << std::endl;
}
void ExampleWindow::on_button_close()
Modified: trunk/examples/book/entry/icon/examplewindow.h
==============================================================================
--- /trunk/examples/book/entry/simple/examplewindow.h (original)
+++ trunk/examples/book/entry/icon/examplewindow.h Tue Mar 17 12:17:38 2009
@@ -29,16 +29,13 @@
protected:
//Signal handlers:
- virtual void on_checkbox_editable_toggled();
- virtual void on_checkbox_visibility_toggled();
- virtual void on_button_close();
+ void on_icon_pressed(Gtk::EntryIconPosition icon_pos, const GdkEventButton* event);
+ void on_button_close();
//Child widgets:
- Gtk::HBox m_HBox;
Gtk::VBox m_VBox;
Gtk::Entry m_Entry;
Gtk::Button m_Button_Close;
- Gtk::CheckButton m_CheckButton_Editable, m_CheckButton_Visible;
};
#endif //GTKMM_EXAMPLEWINDOW_H
Modified: trunk/examples/book/entry/progress/examplewindow.cc
==============================================================================
--- /trunk/examples/book/entry/simple/examplewindow.cc (original)
+++ trunk/examples/book/entry/progress/examplewindow.cc Tue Mar 17 12:17:38 2009
@@ -20,37 +20,25 @@
#include <iostream>
ExampleWindow::ExampleWindow()
-: m_Button_Close("Close"),
- m_CheckButton_Editable("Editable"),
- m_CheckButton_Visible("Visible")
+: m_Button_Close("Close")
{
- set_size_request(200, 100);
set_title("Gtk::Entry");
add(m_VBox);
m_Entry.set_max_length(50);
- m_Entry.set_text("hello");
- m_Entry.set_text(m_Entry.get_text() + " world");
- m_Entry.select_region(0, m_Entry.get_text_length());
- m_VBox.pack_start(m_Entry);
-
- // Note that add() can also be used instead of pack_xxx()
- m_VBox.add(m_HBox);
-
- m_HBox.pack_start(m_CheckButton_Editable);
- m_CheckButton_Editable.signal_toggled().connect( sigc::mem_fun(*this,
- &ExampleWindow::on_checkbox_editable_toggled) );
- m_CheckButton_Editable.set_active(true);
-
- m_HBox.pack_start(m_CheckButton_Visible);
- m_CheckButton_Visible.signal_toggled().connect( sigc::mem_fun(*this,
- &ExampleWindow::on_checkbox_visibility_toggled) );
- m_CheckButton_Visible.set_active(true);
+ m_Entry.set_text("Hello world");
+ m_VBox.pack_start(m_Entry, Gtk::PACK_SHRINK);
+
+ //Change the progress fraction every 0.1 second:
+ Glib::signal_timeout().connect(
+ sigc::mem_fun(*this, &ExampleWindow::on_timeout),
+ 100
+ );
m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
&ExampleWindow::on_button_close) );
- m_VBox.pack_start(m_Button_Close);
+ m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
m_Button_Close.grab_default();
@@ -61,14 +49,16 @@
{
}
-void ExampleWindow::on_checkbox_editable_toggled()
+bool ExampleWindow::on_timeout()
{
- m_Entry.set_editable(m_CheckButton_Editable.get_active());
-}
+ static double fraction = 0;
+ m_Entry.set_progress_fraction(fraction);
-void ExampleWindow::on_checkbox_visibility_toggled()
-{
- m_Entry.set_visibility(m_CheckButton_Visible.get_active());
+ fraction += 0.01;
+ if(fraction > 1)
+ fraction = 0;
+
+ return true;
}
void ExampleWindow::on_button_close()
Modified: trunk/examples/book/entry/progress/examplewindow.h
==============================================================================
--- /trunk/examples/book/entry/simple/examplewindow.h (original)
+++ trunk/examples/book/entry/progress/examplewindow.h Tue Mar 17 12:17:38 2009
@@ -29,16 +29,13 @@
protected:
//Signal handlers:
- virtual void on_checkbox_editable_toggled();
- virtual void on_checkbox_visibility_toggled();
- virtual void on_button_close();
+ bool on_timeout();
+ void on_button_close();
//Child widgets:
- Gtk::HBox m_HBox;
Gtk::VBox m_VBox;
Gtk::Entry m_Entry;
Gtk::Button m_Button_Close;
- Gtk::CheckButton m_CheckButton_Editable, m_CheckButton_Visible;
};
#endif //GTKMM_EXAMPLEWINDOW_H
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]