[gtkmm] Gtk: Update class hierarchy for some widgets



commit df265bea638e1972bd5f6c65465d66203235baf4
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat Nov 9 21:08:30 2019 +0100

    Gtk: Update class hierarchy for some widgets
    
    * gtk/src/appchooserbutton.hg: Inherit from Widget. Add signal_changed().
    * gtk/src/infobar.hg: Inherit from Container.
    * gtk/src/stacksidebar.hg: Inherit from Widget.
    * gtk/src/stackswitcher.hg: Inherit from Widget.
    
    Corresponding changes have been made in gtk. Unfortunately such mismatches
    between gtk and gtkmm are not reported as errors when gtkmm is built.
    They show up as hard-to-find run-time errors.

 gtk/src/appchooserbutton.hg | 11 ++++++-----
 gtk/src/infobar.hg          | 11 ++++-------
 gtk/src/stacksidebar.hg     | 18 +++++++-----------
 gtk/src/stackswitcher.hg    | 17 ++++++-----------
 4 files changed, 23 insertions(+), 34 deletions(-)
---
diff --git a/gtk/src/appchooserbutton.hg b/gtk/src/appchooserbutton.hg
index 7bce7802..6414870e 100644
--- a/gtk/src/appchooserbutton.hg
+++ b/gtk/src/appchooserbutton.hg
@@ -16,9 +16,9 @@
  */
 
 #include <gtkmm/appchooser.h>
-#include <gtkmm/combobox.h>
+#include <gtkmm/widget.h>
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/combobox_p.h)
+_PINCLUDE(gtkmm/private/widget_p.h)
 
 
 namespace Gtk
@@ -44,7 +44,7 @@ namespace Gtk
  * These items cause signal_custom_item_activated() to be
  * emitted when they are selected.
  *
- * To track changes in the selected application, use ComboBox::signal_changed().
+ * To track changes in the selected application, use signal_changed().
  *
  * The AppChooserButton widget looks like this:
  * @image html appchooserbutton1.png
@@ -54,10 +54,10 @@ namespace Gtk
  * @newin{3,0}
  */
 class AppChooserButton
-  : public ComboBox,
+  : public Widget,
     public AppChooser
 {
-  _CLASS_GTKOBJECT(AppChooserButton, GtkAppChooserButton, GTK_APP_CHOOSER_BUTTON, ComboBox, GtkComboBox)
+  _CLASS_GTKOBJECT(AppChooserButton, GtkAppChooserButton, GTK_APP_CHOOSER_BUTTON, Widget, GtkWidget)
   _IMPLEMENTS_INTERFACE(AppChooser)
 public:
 
@@ -80,6 +80,7 @@ public:
   _WRAP_METHOD(bool get_show_default_item() const, gtk_app_chooser_button_get_show_default_item)
 
   // no_default_handler because GtkAppChooserButtonClass is private.
+  _WRAP_SIGNAL(void changed(), "changed", no_default_handler)
   _WRAP_SIGNAL(void custom_item_activated(const Glib::ustring& item_name), "custom-item-activated",
     detail_name custom_item_name, no_default_handler)
 
diff --git a/gtk/src/infobar.hg b/gtk/src/infobar.hg
index 6f12e594..56ed3834 100644
--- a/gtk/src/infobar.hg
+++ b/gtk/src/infobar.hg
@@ -15,13 +15,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <gtkmm/box.h>
+#include <gtkmm/container.h>
 #include <gtkmm/button.h>
 #include <gtkmm/enums.h>
 
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/box_p.h)
-
+_PINCLUDE(gtkmm/private/container_p.h)
 
 namespace Gtk
 {
@@ -47,16 +46,14 @@ namespace Gtk
  *
  * @ingroup Widgets
  */
-class InfoBar : public Box
+class InfoBar : public Container
 {
-  _CLASS_GTKOBJECT(InfoBar, GtkInfoBar, GTK_INFO_BAR, Gtk::Box, GtkBox)
+  _CLASS_GTKOBJECT(InfoBar, GtkInfoBar, GTK_INFO_BAR, Gtk::Container, GtkContainer)
 public:
 
   _CTOR_DEFAULT
   _IGNORE(gtk_info_bar_new, gtk_info_bar_new_with_buttons)
 
-
-
 //TODO: What types are these widgets really?
   _WRAP_METHOD(Widget* get_action_area(), gtk_info_bar_get_action_area)
   _WRAP_METHOD(const Widget* get_action_area() const, gtk_info_bar_get_action_area)
diff --git a/gtk/src/stacksidebar.hg b/gtk/src/stacksidebar.hg
index 173d5441..7f311513 100644
--- a/gtk/src/stacksidebar.hg
+++ b/gtk/src/stacksidebar.hg
@@ -14,35 +14,31 @@
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <gtkmm/bin.h>
+#include <gtkmm/widget.h>
 #include <gtkmm/stack.h>
 
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/bin_p.h)
+_PINCLUDE(gtkmm/private/widget_p.h)
 
 namespace Gtk
 {
 class Stack;
 
-// Gtk::StackSidebar is formally a container widget, but it's not included
-// in group Containers. A StackSidebar adds its children itself, when a Stack
-// is connected. Users of StackSidebar shall not call its inherited add() method.
-
 /** Sidebar widget that shows the pages of a Stack.
  *
- * A StackSidebar enables you to quickly and easily provide a
+ * A %StackSidebar enables you to quickly and easily provide a
  * consistent "sidebar" object for your user interface.
  *
- * In order to use a StackSidebar, you simply use a Stack to
+ * In order to use a %StackSidebar, you simply use a Stack to
  * organize your UI flow, and add the sidebar to your sidebar area. You
- * can use set_stack() to connect the StackSidebar to the Stack.
+ * can use set_stack() to connect the %StackSidebar to the Stack.
  *
  * @ingroup Widgets
  * @newin{3,16}
  */
-class StackSidebar : public Bin
+class StackSidebar : public Widget
 {
-  _CLASS_GTKOBJECT(StackSidebar,GtkStackSidebar,GTK_STACK_SIDEBAR,Gtk::Bin,GtkBin)
+  _CLASS_GTKOBJECT(StackSidebar, GtkStackSidebar, GTK_STACK_SIDEBAR, Gtk::Widget, GtkWidget)
 public:
   _CTOR_DEFAULT
 
diff --git a/gtk/src/stackswitcher.hg b/gtk/src/stackswitcher.hg
index 93f463a1..3e9ffa18 100644
--- a/gtk/src/stackswitcher.hg
+++ b/gtk/src/stackswitcher.hg
@@ -16,19 +16,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <gtkmm/box.h>
+#include <gtkmm/widget.h>
 #include <gtkmm/stack.h>
 
 _DEFS(gtkmm,gtk)
-_PINCLUDE(gtkmm/private/box_p.h)
+_PINCLUDE(gtkmm/private/widget_p.h)
 
 namespace Gtk
 {
-// Gtk::StackSwitcher is formally a container widget, but it's not included
-// in group Containers. A StackSwitcher adds its children itself, when a Stack
-// is connected. Users of StackSwitcher shall not call its inherited add() method.
-
-/** A controller for a Gtk::Stack.
+/** A controller for a %Gtk::Stack.
  *
  * It shows a row of buttons to switch between the various pages of
  * the associated stack widget.
@@ -36,16 +32,15 @@ namespace Gtk
  * All the content for the buttons comes from the child properties of
  * the Gtk::Stack.
  *
- * It is possible to associate multiple StackSwitcher widgets with
+ * It is possible to associate multiple %StackSwitcher widgets with
  * the same stack widget.
  *
  * @ingroup Widgets
  * @newin{3,10}
  */
-class StackSwitcher
-  : public Box
+class StackSwitcher : public Widget
 {
-  _CLASS_GTKOBJECT(StackSwitcher, GtkStackSwitcher, GTK_STACK_SWITCHER, Gtk::Box, GtkBox)
+  _CLASS_GTKOBJECT(StackSwitcher, GtkStackSwitcher, GTK_STACK_SWITCHER, Gtk::Widget, GtkWidget)
 public:
   _CTOR_DEFAULT
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]