[gtkmm] demos: Remove the last traces of the UIManager and stock browser demos
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] demos: Remove the last traces of the UIManager and stock browser demos
- Date: Mon, 18 May 2015 07:02:19 +0000 (UTC)
commit dc450c1059cd988c2df3f26031d551e9f2aaa684
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Mon May 18 08:55:43 2015 +0200
demos: Remove the last traces of the UIManager and stock browser demos
* demos/gtk-demo/demos.h: Remove obsolete comments.
* demos/gtk-demo/example_dialog.cc: Change a button label that refers to
stock icons.
* demos/gtk-demo/example_menus.cc: Replace Gtk::UIManager by Gtk::Builder
in the introductory comment.
* demos/gtk-demo/example_treeview_liststore.cc: Remove a comment that refers
to the stock browser demo.
demos/gtk-demo/demos.h | 9 +------
demos/gtk-demo/example_dialog.cc | 7 +++--
demos/gtk-demo/example_menus.cc | 29 ++++++++++++-------------
demos/gtk-demo/example_treeview_liststore.cc | 8 ++----
4 files changed, 23 insertions(+), 30 deletions(-)
---
diff --git a/demos/gtk-demo/demos.h b/demos/gtk-demo/demos.h
index 94e82bc..5a111a9 100644
--- a/demos/gtk-demo/demos.h
+++ b/demos/gtk-demo/demos.h
@@ -3,15 +3,12 @@
#include "demowindow.h"
-//typedef Gtk::Window* (*GDoDemoFunc) (void);
-
typedef sigc::slot<Gtk::Window*> type_slotDo;
struct Demo
{
const char* title;
const char* filename;
- //GDoDemoFunc func;
type_slotDo slot; //The method to call.
Demo* children;
};
@@ -43,16 +40,14 @@ Gtk::Window* do_treeview_editable_cells();
Gtk::Window* do_treeview_liststore();
Gtk::Window* do_treeview_treestore();
-//Gtk::Window* do_ui_manager();
-
-Demo child0[] = {
+Demo child0[] =
+{
{ "Editable Cells", "example_treeview_editable_cells.cc", sigc::ptr_fun(&do_treeview_editable_cells), 0 },
{ "List Store", "example_treeview_liststore.cc", sigc::ptr_fun(&do_treeview_liststore), 0 },
{ "Tree Store", "example_treeview_treestore.cc", sigc::ptr_fun(&do_treeview_treestore), 0 },
{ 0, 0, type_slotDo(), 0 }
};
-
Demo testgtk_demos[] =
{
{ "Application main window", "example_appwindow.cc", sigc::ptr_fun(&do_appwindow), 0 },
diff --git a/demos/gtk-demo/example_dialog.cc b/demos/gtk-demo/example_dialog.cc
index 5240277..19cedeb 100644
--- a/demos/gtk-demo/example_dialog.cc
+++ b/demos/gtk-demo/example_dialog.cc
@@ -61,7 +61,8 @@ Example_Dialog::Example_Dialog()
m_VBox(Gtk::ORIENTATION_VERTICAL, 8),
m_HBox(Gtk::ORIENTATION_HORIZONTAL, 8), m_HBox2(Gtk::ORIENTATION_HORIZONTAL, 8),
m_Button_Message("_Message Dialog", true), m_Button_Interactive("_Interactive Dialog", true),
- m_Label1("_Entry 1", true), m_Label2("E_ntry 2")
+ m_Label1("_Entry 1", true),
+ m_Label2("E_ntry 2", true)
{
m_count = 0;
@@ -115,7 +116,7 @@ void Example_Dialog::on_button_message()
Glib::ScopedPtr<char> buf (g_strdup_printf("%d", m_count));
strMessage += buf.get();
}
- Gtk::MessageDialog dialog(strMessage, false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); //true = modal
+ Gtk::MessageDialog dialog(*this, strMessage, false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); //true =
modal
/*int response =*/ dialog.run();
m_count++;
@@ -139,7 +140,7 @@ Dialog_Interactive::Dialog_Interactive(Gtk::Window& parent, const Glib::ustring&
{
m_Image.set_from_icon_name("dialog-question", Gtk::ICON_SIZE_DIALOG);
add_button("_OK", Gtk::RESPONSE_OK);
- add_button("_Non-stock Button", Gtk::RESPONSE_CANCEL);
+ add_button("_Cancel", Gtk::RESPONSE_CANCEL);
m_HBox.set_border_width(8);
get_content_area()->pack_start(m_HBox, Gtk::PACK_SHRINK);
diff --git a/demos/gtk-demo/example_menus.cc b/demos/gtk-demo/example_menus.cc
index 13a9d35..d19f1e5 100644
--- a/demos/gtk-demo/example_menus.cc
+++ b/demos/gtk-demo/example_menus.cc
@@ -1,27 +1,26 @@
/* Menus
*
* There are several widgets involved in displaying menus. The
- * GtkMenuBar widget is a horizontal menu bar, which normally appears
- * at the top of an application. The GtkMenu widget is the actual menu
- * that pops up. Both GtkMenuBar and GtkMenu are subclasses of
- * GtkMenuShell; a GtkMenuShell contains menu items
- * (GtkMenuItem). Each menu item contains text and/or images and can
- * be selected by the user.
+ * Gtk::MenuBar widget is a menu bar, which normally appears horizontally
+ * at the top of an application, but can also be layed out vertically.
+ * The Gtk::Menu widget is the actual menu that pops up. Both Gtk::MenuBar
+ * and Gtk::Menu are subclasses of Gtk::MenuShell; a Gtk::MenuShell contains
+ * menu items (Gtk::MenuItem). Each menu item contains text and/or images
+ * and can be selected by the user.
*
- * There are several kinds of menu item, including plain GtkMenuItem,
- * GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem
+ * There are several kinds of menu item, including plain Gtk::MenuItem,
+ * Gtk::CheckMenuItem which can be checked/unchecked, Gtk::RadioMenuItem
* which is a check menu item that's in a mutually exclusive group,
- * GtkSeparatorMenuItem which is a separator bar, and GtkImageMenuItem which
- * can place a GtkImage or other widget next to the menu text.
+ * Gtk::SeparatorMenuItem which is a separator bar, and Gtk::ImageMenuItem which
+ * can place a Gtk::Image or other widget next to the menu text.
*
- * A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop
+ * A Gtk::MenuItem can have a submenu, which is simply a Gtk::Menu to pop
* up when the menu item is selected. Typically, all menu items in a menu bar
* have submenus.
*
- * GtkUIManager provides a higher-level interface for creating menu bars
+ * Gtk::Builder provides a higher-level interface for creating menu bars
* and menus; while you can construct menus manually, most people don't
- * do that. There's a separate demo for GtkUIManager.
- *
+ * do that. There's a separate demo for Gtk::Builder.
*/
#include "gtkmm.h"
@@ -68,7 +67,7 @@ Example_Menus::Example_Menus()
m_VBox1.pack_start(m_MenuBar, Gtk::PACK_SHRINK);
{
- //Note:: It's generally easier to use the Gtk::UIManager API.
+ //Note:: It's generally easier to use the Gtk::Builder API.
Gtk::MenuItem* pMenuItem = Gtk::manage(new Gtk::MenuItem("test\nline2"));
pMenuItem->set_submenu( *(create_menu(2)) );
m_MenuBar.append(*pMenuItem);
diff --git a/demos/gtk-demo/example_treeview_liststore.cc b/demos/gtk-demo/example_treeview_liststore.cc
index 189539a..7b777e0 100644
--- a/demos/gtk-demo/example_treeview_liststore.cc
+++ b/demos/gtk-demo/example_treeview_liststore.cc
@@ -1,10 +1,8 @@
/* Tree View/List Store
*
- * The GtkListStore is used to store data in list form, to be used
- * later on by a GtkTreeView to display it. This demo builds a
- * simple GtkListStore and displays it. See the Stock Browser
- * demo for a more advanced example.
- *
+ * The Gtk::ListStore is used to store data in list form, to be used
+ * later on by a Gtk::TreeView to display it. This demo builds a
+ * simple Gtk::ListStore and displays it.
*/
#include <gtkmm.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]