[gtkmm] Gtk::PopoverMenu: Update documentation



commit b4ec34c40ae9da2861211db637eed16c23fbfd02
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Jan 12 16:23:04 2020 +0100

    Gtk::PopoverMenu: Update documentation
    
    Don't refer to removed menu classes.
    Constructors: Add default value to the 'model' parameter.

 .gitignore             | 16 ++--------------
 gtk/src/popovermenu.hg | 44 +++++++++++++++++++++-----------------------
 2 files changed, 23 insertions(+), 37 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1f837c24..292a5f25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -212,8 +212,6 @@ gtk/gtkmm/centerlayout.cc
 gtk/gtkmm/centerlayout.h
 gtk/gtkmm/checkbutton.cc
 gtk/gtkmm/checkbutton.h
-gtk/gtkmm/checkmenuitem.cc
-gtk/gtkmm/checkmenuitem.h
 gtk/gtkmm/colorbutton.cc
 gtk/gtkmm/colorbutton.h
 gtk/gtkmm/colorchooser.cc
@@ -358,16 +356,8 @@ gtk/gtkmm/mediafile.cc
 gtk/gtkmm/mediafile.h
 gtk/gtkmm/mediastream.cc
 gtk/gtkmm/mediastream.h
-gtk/gtkmm/menu.cc
-gtk/gtkmm/menu.h
-gtk/gtkmm/menubar.cc
-gtk/gtkmm/menubar.h
 gtk/gtkmm/menubutton.cc
 gtk/gtkmm/menubutton.h
-gtk/gtkmm/menuitem.cc
-gtk/gtkmm/menuitem.h
-gtk/gtkmm/menushell.cc
-gtk/gtkmm/menushell.h
 gtk/gtkmm/menutoolbutton.cc
 gtk/gtkmm/menutoolbutton.h
 gtk/gtkmm/messagedialog.cc
@@ -408,6 +398,8 @@ gtk/gtkmm/popover.cc
 gtk/gtkmm/popover.h
 gtk/gtkmm/popovermenu.cc
 gtk/gtkmm/popovermenu.h
+gtk/gtkmm/popovermenubar.cc
+gtk/gtkmm/popovermenubar.h
 gtk/gtkmm/printcontext.cc
 gtk/gtkmm/printcontext.h
 gtk/gtkmm/printer.cc
@@ -426,8 +418,6 @@ gtk/gtkmm/progressbar.cc
 gtk/gtkmm/progressbar.h
 gtk/gtkmm/radiobutton.cc
 gtk/gtkmm/radiobutton.h
-gtk/gtkmm/radiomenuitem.cc
-gtk/gtkmm/radiomenuitem.h
 gtk/gtkmm/radiotoolbutton.cc
 gtk/gtkmm/radiotoolbutton.h
 gtk/gtkmm/range.cc
@@ -462,8 +452,6 @@ gtk/gtkmm/selectionmodel.cc
 gtk/gtkmm/selectionmodel.h
 gtk/gtkmm/separator.cc
 gtk/gtkmm/separator.h
-gtk/gtkmm/separatormenuitem.cc
-gtk/gtkmm/separatormenuitem.h
 gtk/gtkmm/separatortoolitem.cc
 gtk/gtkmm/separatortoolitem.h
 gtk/gtkmm/settings.cc
diff --git a/gtk/src/popovermenu.hg b/gtk/src/popovermenu.hg
index 9adc98ec..48babb16 100644
--- a/gtk/src/popovermenu.hg
+++ b/gtk/src/popovermenu.hg
@@ -22,29 +22,27 @@ _PINCLUDE(gtkmm/private/popover_p.h)
 
 namespace Gtk
 {
+/** @defgroup Menus Menu classes
+ * @see Gio::Menu, Gio::MenuItem, Gio::MenuModel, Gio::SimpleActionGroup
+ */
+
 /** A Popover to use as a menu.
  *
  * %PopoverMenu is a subclass of Popover that treats its
- * childen like menus and allows switching between them. It is
- * meant to be used primarily together with ModelButton, but
- * any widget can be used, such as SpinButton or Scale.
- * In this respect, %PopoverMenu is more flexible than popovers
- * that are created from a Gio::MenuModel.
- *
- * To add a child as a submenu, use add_submenu().
- * To let the user open this submenu, add a ModelButton whose
- * ModelButton::property_menu_name() is set to the name you've given
- * to the submenu.
+ * children like menus and allows switching between them. It
+ * can open submenus as traditional, nested submenus, or in a
+ * more touch-friendly sliding fashion.
  *
- * To add a named submenu in a ui file, set Widget::property_name()
- * of the widget that you are adding as a child of the popover menu.
+ * %PopoverMenu is meant to be used primarily with menu models,
+ * using one of the constructors or set_menu_model(). If you need to put
+ * other widgets such as SpinButton or Switch into a popover, use a Popover.
  *
- * By convention, the first child of a submenu should be a ModelButton
- * to switch back to the parent menu. Such a button should use
- * ModelButton::property_inverted() and ModelButton::property_centered()
- * to achieve a title-like appearance and place the submenu indicator
- * at the opposite side. To switch back to the main menu, use "main"
- * as the menu name.
+ * In addition to all the regular menu model features, this function
+ * supports rendering sections in the model in a more compact form,
+ * as a row of image buttons instead of menu items.
+ * To use this rendering, set the ”display-hint” attribute of the
+ * section to ”horizontal-buttons” and set the icons of your items
+ * with the ”verb-icon” attribute.
  *
  * @newin{3,18}
  *
@@ -60,7 +58,7 @@ public:
   _WRAP_ENUM(Flags, GtkPopoverMenuFlags)
 
   //This is custom-implemented because the gtk_popover_menu_new_from_model() does more
-  //than just call g_object_new. MenuBar and Menu have both the same issue.
+  //than just call g_object_new().
   //See https://bugzilla.gnome.org/show_bug.cgi?id=704671
   /** Creates a %PopoverMenu and populates it according to @a model.
    * The popover menu is pointed to the @a relative_to widget.
@@ -78,11 +76,11 @@ public:
    * nested submenus instead of the default sliding submenus.
    *
    * @param relative_to Widget the popover menu is related to
-   * @param model A Gio::MenuModel
+   * @param model A Gio::MenuModel or an empty Glib::RefPtr
    * @param flags Flags that affect how the menu is created
    */
   explicit PopoverMenu(const Widget& relative_to,
-    const Glib::RefPtr<Gio::MenuModel>& model, Flags flags = static_cast<Flags>(0));
+    const Glib::RefPtr<Gio::MenuModel>& model = {}, Flags flags = static_cast<Flags>(0));
 
   /** Creates a %PopoverMenu and populates it according to @a model.
    *
@@ -98,10 +96,10 @@ public:
    * Gtk::PopoverMenu::Flags::NESTED, which makes GTK create traditional,
    * nested submenus instead of the default sliding submenus.
    *
-   * @param model A Gio::MenuModel
+   * @param model A Gio::MenuModel or an empty Glib::RefPtr
    * @param flags Flags that affect how the menu is created
    */
-  explicit PopoverMenu(const Glib::RefPtr<Gio::MenuModel>& model,
+  explicit PopoverMenu(const Glib::RefPtr<Gio::MenuModel>& model = {},
     Flags flags = static_cast<Flags>(0));
   _IGNORE(gtk_popover_menu_new_from_model, gtk_popover_menu_new_from_model_full)
 


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