[gtkmm] Fix make check
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Fix make check
- Date: Wed, 26 Oct 2011 12:37:46 +0000 (UTC)
commit 48ef7955c450814b42d408a3d8abad139afe6a14
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Oct 26 14:34:37 2011 +0200
Fix make check
* demos/gtk-demo/example_appwindow.cc:
* demos/gtk-demo/example_dialog.cc:
* demos/gtk-demo/example_drawingarea.cc:
* demos/gtk-demo/example_menus.cc:
* demos/gtk-demo/example_panes.cc:
* demos/gtk-demo/example_sizegroup.cc: Replace Table with Grid.
Remove use of TearOffMenuItems. Replace use of Gdk::Window::get_pointer().
I have no idea if this actually works but it builds.
ChangeLog | 13 +++++++++++++
demos/gtk-demo/example_appwindow.cc | 26 +++++++++++---------------
demos/gtk-demo/example_dialog.cc | 14 ++++++--------
demos/gtk-demo/example_drawingarea.cc | 6 +++---
demos/gtk-demo/example_menus.cc | 24 ++++++++----------------
demos/gtk-demo/example_panes.cc | 2 +-
demos/gtk-demo/example_sizegroup.cc | 22 +++++++++++-----------
7 files changed, 53 insertions(+), 54 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7911e52..c89436e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2011-10-26 Murray Cumming <murrayc murrayc com>
+ Fix make check
+
+ * demos/gtk-demo/example_appwindow.cc:
+ * demos/gtk-demo/example_dialog.cc:
+ * demos/gtk-demo/example_drawingarea.cc:
+ * demos/gtk-demo/example_menus.cc:
+ * demos/gtk-demo/example_panes.cc:
+ * demos/gtk-demo/example_sizegroup.cc: Replace Table with Grid.
+ Remove use of TearOffMenuItems. Replace use of Gdk::Window::get_pointer().
+ I have no idea if this actually works but it builds.
+
+2011-10-26 Murray Cumming <murrayc murrayc com>
+
Avoid some more deprecation warnings with the recent GTK+.
* gdk/src/window.hg: Deprecate get_pointer().
diff --git a/demos/gtk-demo/example_appwindow.cc b/demos/gtk-demo/example_appwindow.cc
index d9b34af..3b1aedc 100644
--- a/demos/gtk-demo/example_appwindow.cc
+++ b/demos/gtk-demo/example_appwindow.cc
@@ -18,7 +18,7 @@ protected:
virtual void on_text_mark_set(const Gtk::TextBuffer::iterator& new_location, const Glib::RefPtr<Gtk::TextBuffer::Mark>& mark);
//Member widgets:
- Gtk::Table m_Table;
+ Gtk::Grid m_Grid;
Gtk::Menu m_Menubar;
Gtk::Toolbar m_Toolbar;
Gtk::ScrolledWindow m_ScrolledWindow;
@@ -35,11 +35,10 @@ Gtk::Window* do_appwindow()
Example_AppWindow::Example_AppWindow()
-: m_Table(1, 4)
{
set_title("Application Window");
- add(m_Table);
+ add(m_Grid);
/*
//Menu:
@@ -91,8 +90,8 @@ Example_AppWindow::Example_AppWindow()
list_bar.push_front(MenuElem("_Preferences", *pMenuPreferences));
list_bar.push_front(MenuElem("_File", *pMenuFile));
- //Add the menu bar to the Table:
- m_Table.attach(m_Menubar,
+ //Add the menu bar to the Grid:
+ m_Grid.attach(m_Menubar,
// X direction Y direction
0, 1, 0, 1,
Gtk::FILL|Gtk::EXPAND, Gtk::AttachOptions(0)
@@ -102,17 +101,16 @@ Example_AppWindow::Example_AppWindow()
*/
//Toolbar:
{
- m_Table.attach(m_Toolbar,
+ m_Toolbar.set_hexpand();
+ m_Grid.attach(m_Toolbar,
/* X direction */ /* Y direction */
- 0, 1, 1, 2,
- Gtk::FILL|Gtk::EXPAND, Gtk::AttachOptions(0)
- );
+ 0, 1, 1, 2);
}
m_ScrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_ScrolledWindow.set_shadow_type(Gtk::SHADOW_IN);
- m_Table.attach(m_ScrolledWindow,
+ m_Grid.attach(m_ScrolledWindow,
/* X direction */ /* Y direction */
0, 1, 2, 3);
@@ -122,12 +120,10 @@ Example_AppWindow::Example_AppWindow()
/* Create statusbar */
-
- m_Table.attach(m_Statusbar,
+ m_Statusbar.set_hexpand();
+ m_Grid.attach(m_Statusbar,
/* X direction */ /* Y direction */
- 0, 1, 3, 4,
- Gtk::FILL|Gtk::EXPAND, Gtk::AttachOptions(0)
- );
+ 0, 1, 3, 4);
/* Show text widget info in the statusbar */
diff --git a/demos/gtk-demo/example_dialog.cc b/demos/gtk-demo/example_dialog.cc
index 7d9db7e..a406b1f 100644
--- a/demos/gtk-demo/example_dialog.cc
+++ b/demos/gtk-demo/example_dialog.cc
@@ -23,7 +23,7 @@ protected:
Gtk::Box m_VBox, m_VBox2;
Gtk::Box m_HBox, m_HBox2;
Gtk::Button m_Button_Message, m_Button_Interactive;
- Gtk::Table m_Table;
+ Gtk::Grid m_Table;
Gtk::Label m_Label1, m_Label2;
Gtk::Entry m_Entry1, m_Entry2;
@@ -42,7 +42,7 @@ public:
protected:
//Member widgets:
Gtk::Box m_HBox;
- Gtk::Table m_Table;
+ Gtk::Grid m_Table;
Gtk::Label m_Label1, m_Label2;
Gtk::Entry m_Entry1, m_Entry2;
Gtk::Image m_Image;
@@ -61,7 +61,6 @@ 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_Table(2, 2, false),
m_Label1("_Entry 1", true), m_Label2("E_ntry 2")
{
m_count = 0;
@@ -89,8 +88,8 @@ Example_Dialog::Example_Dialog()
m_VBox2.pack_start(m_Button_Interactive, Gtk::PACK_SHRINK);
- m_Table.set_row_spacings(4);
- m_Table.set_col_spacings(4);
+ m_Table.set_row_spacing(4);
+ m_Table.set_column_spacing(4);
m_HBox2.pack_start(m_Table, Gtk::PACK_SHRINK);
m_Table.attach(m_Label1, 0, 1, 0, 1);
@@ -135,7 +134,6 @@ void Example_Dialog::on_button_interactive()
Dialog_Interactive::Dialog_Interactive(Gtk::Window& parent, const Glib::ustring& entry1, const Glib::ustring& entry2)
: Gtk::Dialog("Interactive Dialog", parent, true),
m_HBox(Gtk::ORIENTATION_HORIZONTAL, 8),
- m_Table(2, 2, false),
m_Label1("_Entry 1", true), m_Label2("E_ntry 2", true),
m_Image(Gtk::Stock::DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG)
{
@@ -146,8 +144,8 @@ Dialog_Interactive::Dialog_Interactive(Gtk::Window& parent, const Glib::ustring&
get_content_area()->pack_start(m_HBox, Gtk::PACK_SHRINK);
m_HBox.pack_start(m_Image, Gtk::PACK_SHRINK);
- m_Table.set_row_spacings(4);
- m_Table.set_col_spacings(4);
+ m_Table.set_row_spacing(4);
+ m_Table.set_column_spacing(4);
m_HBox.pack_start(m_Table);
m_Table.attach(m_Label1, 0, 1, 0, 1);
diff --git a/demos/gtk-demo/example_drawingarea.cc b/demos/gtk-demo/example_drawingarea.cc
index 663619c..2aabd9f 100644
--- a/demos/gtk-demo/example_drawingarea.cc
+++ b/demos/gtk-demo/example_drawingarea.cc
@@ -187,7 +187,7 @@ bool Example_DrawingArea::on_drawingarea_scribble_motion_notify_event(GdkEventMo
return false; // paranoia check, in case we haven't gotten a configure event
/* This call is very important; it requests the next motion event. If you
- * don't call Gdk::Window::get_pointer() you'll only get a single motion
+ * don't call Gdk::Window::get_device_position() you'll only get a single motion
* event. The reason is that we specified Gdk::POINTER_MOTION_HINT_MASK to
* Gtk::Widget::add_events(). If we hadn't specified that, we could just use
* event->x, event->y as the pointer location. But we'd also get deluged in
@@ -203,8 +203,8 @@ bool Example_DrawingArea::on_drawingarea_scribble_motion_notify_event(GdkEventMo
{
int x = 0, y = 0;
Gdk::ModifierType state = Gdk::ModifierType(0);
-
- refWindow->get_pointer(x, y, state);
+ const Glib::RefPtr<const Gdk::Device> device = Glib::wrap(event->device);
+ refWindow->get_device_position(device, x, y, state);
if((state & Gdk::BUTTON1_MASK) != 0)
scribble_draw_brush(x, y);
diff --git a/demos/gtk-demo/example_menus.cc b/demos/gtk-demo/example_menus.cc
index 59fe48b..0b0019e 100644
--- a/demos/gtk-demo/example_menus.cc
+++ b/demos/gtk-demo/example_menus.cc
@@ -11,8 +11,7 @@
* There are several kinds of menu item, including plain GtkMenuItem,
* GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem
* which is a check menu item that's in a mutually exclusive group,
- * GtkSeparatorMenuItem which is a separator bar, GtkTearoffMenuItem
- * which allows a GtkMenu to be torn off, and GtkImageMenuItem which
+ * GtkSeparatorMenuItem which is a separator bar, and GtkImageMenuItem which
* can place a GtkImage or other widget next to the menu text.
*
* A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop
@@ -38,7 +37,7 @@ protected:
//signal handlers:
virtual void on_button_clicked();
- virtual Gtk::Menu* create_menu(gint depth, bool tearoff);
+ virtual Gtk::Menu* create_menu(gint depth);
//Member widgets:
Gtk::Frame m_Frame_Horizontal, m_Frame_Vertical;
@@ -71,17 +70,17 @@ Example_Menus::Example_Menus()
{
//Note:: It's generally easier to use the Gtk::UIManager API.
Gtk::MenuItem* pMenuItem = Gtk::manage(new Gtk::MenuItem("test\nline2"));
- pMenuItem->set_submenu( *(create_menu(2, true)) );
+ pMenuItem->set_submenu( *(create_menu(2)) );
m_MenuBar.append(*pMenuItem);
pMenuItem->show();
pMenuItem = Gtk::manage(new Gtk::MenuItem("foo"));
- pMenuItem->set_submenu( *(create_menu(3, true)) );
+ pMenuItem->set_submenu( *(create_menu(3)) );
m_MenuBar.append(*pMenuItem);
pMenuItem->show();
pMenuItem = Gtk::manage(new Gtk::MenuItem("bar"));
- pMenuItem->set_submenu( *(create_menu(4, true)) );
+ pMenuItem->set_submenu( *(create_menu(4)) );
pMenuItem->set_right_justified();
m_MenuBar.append(*pMenuItem);
pMenuItem->show();
@@ -92,7 +91,7 @@ Example_Menus::Example_Menus()
m_VBox1.pack_start(m_VBox_Sub1);
{
- Gtk::Menu* pMenu = create_menu(1, false);
+ Gtk::Menu* pMenu = create_menu(1);
pMenu->set_accel_group(get_accel_group());
Gtk::MenuItem* pMenuItem = Gtk::manage(new Gtk::SeparatorMenuItem());
@@ -134,7 +133,7 @@ Example_Menus::~Example_Menus()
{
}
-Gtk::Menu* Example_Menus::create_menu(gint depth, bool tearoff)
+Gtk::Menu* Example_Menus::create_menu(gint depth)
{
if (depth < 1)
return 0;
@@ -142,13 +141,6 @@ Gtk::Menu* Example_Menus::create_menu(gint depth, bool tearoff)
Gtk::Menu* pMenu = Gtk::manage(new Gtk::Menu());
{
- if(tearoff)
- {
- Gtk::MenuItem* menu_item = Gtk::manage(new Gtk::TearoffMenuItem());
- pMenu->append(*menu_item);
- menu_item->show();
- }
-
Gtk::RadioMenuItem::Group radiogroup;
for(int i = 0, j = 1; i < 5; i++, j++)
@@ -163,7 +155,7 @@ Gtk::Menu* Example_Menus::create_menu(gint depth, bool tearoff)
if(i == 3)
pMenuItem->set_sensitive(false);
- Gtk::Menu* pSubMenu = create_menu(depth - 1, true);
+ Gtk::Menu* pSubMenu = create_menu(depth - 1);
if(pSubMenu)
pMenuItem->set_submenu(*pSubMenu);
}
diff --git a/demos/gtk-demo/example_panes.cc b/demos/gtk-demo/example_panes.cc
index 6ae8de3..feb58a8 100644
--- a/demos/gtk-demo/example_panes.cc
+++ b/demos/gtk-demo/example_panes.cc
@@ -98,7 +98,7 @@ PaneOptions::PaneOptions(Gtk::Paned& paned, const Glib::ustring& frame_label,
{
set_border_width(4);
- Gtk::Table *const pTable = new Gtk::Table(3, 2, true);
+ Gtk::Grid *const pTable = new Gtk::Grid();
add(*Gtk::manage(pTable));
pTable->attach(*Gtk::manage(new Gtk::Label(label1)), 0, 1, 0, 1);
diff --git a/demos/gtk-demo/example_sizegroup.cc b/demos/gtk-demo/example_sizegroup.cc
index 42e98f5..2522e88 100644
--- a/demos/gtk-demo/example_sizegroup.cc
+++ b/demos/gtk-demo/example_sizegroup.cc
@@ -3,7 +3,7 @@
* GtkSizeGroup provides a mechanism for grouping a number of
* widgets together so they all request the same amount of space.
* This is typically useful when you want a column of widgets to
- * have the same size, but you can't use a GtkTable widget.
+ * have the same size, but you can't use a GtkGrid widget.
*
* Note that size groups only affect the amount of space requested,
* not the size that the widgets finally receive. If you want the
@@ -27,7 +27,7 @@ protected:
virtual void on_checkbutton_toggled();
typedef std::list<Glib::ustring> type_listStrings;
- virtual void add_row(Gtk::Table& table, int row, const Glib::RefPtr<Gtk::SizeGroup>& size_group, const Glib::ustring& label_text, const std::list<Glib::ustring>& options);
+ virtual void add_row(Gtk::Grid& table, int row, const Glib::RefPtr<Gtk::SizeGroup>& size_group, const Glib::ustring& label_text, const std::list<Glib::ustring>& options);
virtual Gtk::ComboBoxText* create_combobox(const std::list<Glib::ustring>& strings);
virtual void on_response(int response_id);
@@ -37,7 +37,7 @@ protected:
Gtk::Box m_VBox;
Gtk::Box m_HBox;
Glib::RefPtr<Gtk::SizeGroup> m_refSizeGroup;
- Gtk::Table m_Table_Color, m_Table_Line;
+ Gtk::Grid m_Table_Color, m_Table_Line;
Gtk::CheckButton m_CheckButton;
};
@@ -53,7 +53,6 @@ Example_SizeGroup::Example_SizeGroup()
m_Frame_Line("Line Options"),
m_VBox(Gtk::ORIENTATION_VERTICAL, 5),
m_HBox(Gtk::ORIENTATION_HORIZONTAL, 5),
- m_Table_Color(2, 2), m_Table_Line(2, 2),
m_CheckButton("_Enable grouping", true)
{
set_resizable(false);
@@ -69,8 +68,8 @@ Example_SizeGroup::Example_SizeGroup()
m_VBox.pack_start(m_Frame_Color);
m_Table_Color.set_border_width(5);
- m_Table_Color.set_row_spacings(5);
- m_Table_Color.set_col_spacings(10);
+ m_Table_Color.set_row_spacing(5);
+ m_Table_Color.set_column_spacing(10);
m_Frame_Color.add(m_Table_Color);
type_listStrings color_options;
@@ -86,8 +85,8 @@ Example_SizeGroup::Example_SizeGroup()
m_VBox.pack_start(m_Frame_Line, Gtk::PACK_SHRINK);
m_Table_Line.set_border_width(5);
- m_Table_Line.set_row_spacings(5);
- m_Table_Line.set_col_spacings(10);
+ m_Table_Line.set_row_spacing(5);
+ m_Table_Line.set_column_spacing(10);
m_Frame_Line.add(m_Table_Line);
@@ -129,7 +128,7 @@ void Example_SizeGroup::on_checkbutton_toggled()
m_refSizeGroup->set_mode(new_mode);
}
-void Example_SizeGroup::add_row(Gtk::Table& table, int row,
+void Example_SizeGroup::add_row(Gtk::Grid& table, int row,
const Glib::RefPtr<Gtk::SizeGroup>& size_group,
const Glib::ustring& label_text,
const std::list<Glib::ustring>& options)
@@ -137,13 +136,14 @@ void Example_SizeGroup::add_row(Gtk::Table& table, int row,
Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(label_text, true));
pLabel->set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_END);
- table.attach(*pLabel, 0, 1, row, row + 1, Gtk::EXPAND|Gtk::FILL, Gtk::AttachOptions(0));
+ table.attach(*pLabel, 0, 1, row, row + 1);
+ pLabel->set_hexpand();
Gtk::ComboBoxText* pComboBoxText = create_combobox(options);
pLabel->set_mnemonic_widget(*pComboBoxText);
size_group->add_widget(*pComboBoxText);
- table.attach(*pComboBoxText, 1, 2, row, row + 1, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
+ table.attach(*pComboBoxText, 1, 2, row, row + 1);
}
/* Convenience function to create an option menu holding a number of strings
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]