[gtk+] Adapt the testpopover example
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Adapt the testpopover example
- Date: Wed, 29 Oct 2014 10:50:49 +0000 (UTC)
commit 4da281d20b7a6086ee353d176566e2fa0967280a
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 23 23:39:39 2014 -0400
Adapt the testpopover example
We now use GtkPopoverMenu, and just add the model buttons
directly to it.
tests/Makefile.am | 6 +-
tests/popover2.ui | 1106 ++++++++++++++++++++++++++-------------------------
tests/testpopover.c | 34 --
3 files changed, 559 insertions(+), 587 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b54084b..c94448c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -9,8 +9,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/gdk \
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS) \
- $(GDK_DEP_CFLAGS) \
- -pthread
+ $(GDK_DEP_CFLAGS)
DEPS = \
$(top_builddir)/gtk/libgtk-3.la
@@ -20,11 +19,8 @@ LDADD = \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \
- -lgmodule-2.0 \
-lm
-AM_LDFLAGS = -Wl,--export-dynamic -pthread
-
if USE_X11
testsocket_programs = testsocket testsocket_child
diff --git a/tests/popover2.ui b/tests/popover2.ui
index 64896bd..21905f5 100644
--- a/tests/popover2.ui
+++ b/tests/popover2.ui
@@ -1,573 +1,590 @@
<?xml version="1.0"?>
<interface>
- <object class="GtkPopover" id="popover">
+ <object class="GtkPopoverMenu" id="popover">
<child>
- <object class="GtkStack">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="transition-type">slide-left-right</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
<child>
- <object class="GtkBox" id="main">
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="halign">fill</property>
- <property name="margin">10</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">Edit</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.cut</property>
- <property name="text">Cut</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.copy</property>
- <property name="text">Copy</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.paste</property>
- <property name="text">Paste</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">3</property>
- <property name="margin-bottom">3</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">action1</property>
- <property name="text">No action</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action2</property>
- <property name="action-role">check</property>
- <property name="text">Toggle</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action2a</property>
- <property name="action-role">check</property>
- <property name="text">Another Toggle</property>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">Middle Section</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action3</property>
- <property name="action-target">'three'</property>
- <property name="action-role">radio</property>
- <property name="text">Radio 1</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action3</property>
- <property name="action-target">'four'</property>
- <property name="action-role">radio</property>
- <property name="text">Radio 2</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Submenu 1</property>
- <property name="has-submenu">True</property>
- <signal name="clicked" handler="open_submenu1"/>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Submenu 2</property>
- <property name="has-submenu">True</property>
- <signal name="clicked" handler="open_submenu2"/>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">End Section</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action9</property>
- <property name="text">Another Item 9</property>
- <property name="icon">icon9</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action10</property>
- <property name="text">Another Item 10</property>
- </object>
- </child>
+ <property name="halign">start</property>
+ <property name="label">Edit</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.cut</property>
+ <property name="text">Cut</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.copy</property>
+ <property name="text">Copy</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.paste</property>
+ <property name="text">Paste</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">3</property>
+ <property name="margin-bottom">3</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">action1</property>
+ <property name="text">No action</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action2</property>
+ <property name="action-role">check</property>
+ <property name="text">Toggle</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action2a</property>
+ <property name="action-role">check</property>
+ <property name="text">Another Toggle</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label">Middle Section</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action3</property>
+ <property name="action-target">'three'</property>
+ <property name="action-role">radio</property>
+ <property name="text">Radio 1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action3</property>
+ <property name="action-target">'four'</property>
+ <property name="action-role">radio</property>
+ <property name="text">Radio 2</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Submenu 1</property>
+ <property name="has-submenu">True</property>
+ <property name="menu-name">submenu1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Submenu 2</property>
+ <property name="has-submenu">True</property>
+ <property name="menu-name">submenu2</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label">End Section</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action9</property>
+ <property name="text">Another Item 9</property>
+ <property name="icon">icon9</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action10</property>
+ <property name="text">Another Item 10</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Submenu 1</property>
+ <property name="has-submenu">True</property>
+ <property name="inverted">True</property>
+ <property name="centered">True</property>
+ <property name="menu-name">main</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label">5555</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action5</property>
+ <property name="text">Item 5</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action5</property>
+ <property name="text">Item 5a</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action5</property>
+ <property name="text">Item 5b</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="halign">fill</property>
+ <property name="margin-top">10</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">List</property>
+ <property name="action-name">top.set-view</property>
+ <property name="action-target">'list'</property>
+ <property name="action-role">radio</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
+ <property name="icon">icon-list</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Grid</property>
+ <property name="action-name">top.set-view</property>
+ <property name="action-target">'grid'</property>
+ <property name="action-role">radio</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
+ <property name="icon">icon-grid</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action5</property>
+ <property name="text">Item 5c</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action5</property>
+ <property name="text">Item 5d</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label">Format</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="halign">fill</property>
+ <property name="margin-top">10</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Bold</property>
+ <property name="action-name">top.bold</property>
+ <property name="action-role">check</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
</object>
<packing>
- <property name="name">main</property>
+ <property name="expand">True</property>
</packing>
</child>
-
<child>
- <object class="GtkBox" id="submenu1">
+ <object class="GtkModelButton">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin">10</property>
-
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Submenu 1</property>
- <property name="has-submenu">True</property>
- <property name="inverted">True</property>
- <property name="centered">True</property>
- <signal name="clicked" handler="open_main"/>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">5555</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action5</property>
- <property name="text">Item 5</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action5</property>
- <property name="text">Item 5a</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action5</property>
- <property name="text">Item 5b</property>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="halign">fill</property>
- <property name="margin-top">10</property>
- <style>
- <class name="linked"/>
- </style>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">List</property>
- <property name="action-name">top.set-view</property>
- <property name="action-target">'list'</property>
- <property name="action-role">radio</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- <property name="icon">icon-list</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Grid</property>
- <property name="action-name">top.set-view</property>
- <property name="action-target">'grid'</property>
- <property name="action-role">radio</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- <property name="icon">icon-grid</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action5</property>
- <property name="text">Item 5c</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action5</property>
- <property name="text">Item 5d</property>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">Format</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="halign">fill</property>
- <property name="margin-top">10</property>
- <style>
- <class name="linked"/>
- </style>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Bold</property>
- <property name="action-name">top.bold</property>
- <property name="action-role">check</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Italic</property>
- <property name="action-name">top.italic</property>
- <property name="action-role">check</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- <property name="icon">icon-italic</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Strikethrough</property>
- <property name="action-name">top.strikethrough</property>
- <property name="action-role">check</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- <property name="icon">icon-strikethrough</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Underline</property>
- <property name="action-name">top.underline</property>
- <property name="action-role">check</property>
- <property name="iconic">True</property>
- <property name="centered">True</property>
- <property name="icon">icon-underline</property>
- </object>
- <packing>
- <property name="expand">True</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">3</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">start</property>
- <property name="label">6666</property>
- <style>
- <class name="separator"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action6</property>
- <property name="text">Item 6</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action6</property>
- <property name="text">Item 6a</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action6</property>
- <property name="text">Item 6b</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action6</property>
- <property name="text">Item 6c</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action6</property>
- <property name="text">Item 6d</property>
- </object>
- </child>
+ <property name="text">Italic</property>
+ <property name="action-name">top.italic</property>
+ <property name="action-role">check</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
+ <property name="icon">icon-italic</property>
</object>
<packing>
- <property name="name">submenu1</property>
+ <property name="expand">True</property>
</packing>
</child>
-
<child>
- <object class="GtkBox" id="submenu2">
+ <object class="GtkModelButton">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin">10</property>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Submenu 2</property>
- <property name="has-submenu">True</property>
- <property name="inverted">True</property>
- <property name="centered">True</property>
- <signal name="clicked" handler="open_main"/>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action7</property>
- <property name="text">Item 7</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Subsubmenu</property>
- <property name="icon">icon9</property>
- <property name="has-submenu">True</property>
- <signal name="clicked" handler="open_subsubmenu"/>
- </object>
- </child>
+ <property name="text">Strikethrough</property>
+ <property name="action-name">top.strikethrough</property>
+ <property name="action-role">check</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
+ <property name="icon">icon-strikethrough</property>
</object>
<packing>
- <property name="name">submenu2</property>
+ <property name="expand">True</property>
</packing>
</child>
-
<child>
- <object class="GtkBox" id="subsubmenu">
+ <object class="GtkModelButton">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="margin">10</property>
-
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="text">Subsubmenu</property>
- <property name="has-submenu">True</property>
- <property name="inverted">True</property>
- <property name="centered">True</property>
- <signal name="clicked" handler="open_submenu2"/>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">action8</property>
- <property name="text">Item 8</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">3</property>
- <property name="margin-bottom">3</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action9</property>
- <property name="text">Item 9</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton">
- <property name="visible">True</property>
- <property name="action-name">top.action10</property>
- <property name="text">Item 10</property>
- </object>
- </child>
-
+ <property name="text">Underline</property>
+ <property name="action-name">top.underline</property>
+ <property name="action-role">check</property>
+ <property name="iconic">True</property>
+ <property name="centered">True</property>
+ <property name="icon">icon-underline</property>
</object>
<packing>
- <property name="name">subsubmenu</property>
+ <property name="expand">True</property>
</packing>
</child>
-
</object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">3</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label">6666</property>
+ <style>
+ <class name="separator"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action6</property>
+ <property name="text">Item 6</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action6</property>
+ <property name="text">Item 6a</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action6</property>
+ <property name="text">Item 6b</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action6</property>
+ <property name="text">Item 6c</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action6</property>
+ <property name="text">Item 6d</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Submenu 2</property>
+ <property name="has-submenu">True</property>
+ <property name="inverted">True</property>
+ <property name="centered">True</property>
+ <property name="menu-name">main</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action7</property>
+ <property name="text">Item 7</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Subsubmenu</property>
+ <property name="icon">icon9</property>
+ <property name="has-submenu">True</property>
+ <property name="menu-name">subsubmenu</property>
+ </object>
+ <packing>
+ <property name="submenu">submenu2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="text">Subsubmenu</property>
+ <property name="has-submenu">True</property>
+ <property name="inverted">True</property>
+ <property name="centered">True</property>
+ <property name="menu-name">submenu2</property>
+ </object>
+ <packing>
+ <property name="submenu">subsubmenu</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">action8</property>
+ <property name="text">Item 8</property>
+ </object>
+ <packing>
+ <property name="submenu">subsubmenu</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">3</property>
+ <property name="margin-bottom">3</property>
+ </object>
+ <packing>
+ <property name="submenu">subsubmenu</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action9</property>
+ <property name="text">Item 9</property>
+ </object>
+ <packing>
+ <property name="submenu">subsubmenu</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkModelButton">
+ <property name="visible">True</property>
+ <property name="action-name">top.action10</property>
+ <property name="text">Item 10</property>
+ </object>
+ <packing>
+ <property name="submenu">subsubmenu</property>
+ </packing>
</child>
</object>
<object class="GThemedIcon" id="icon9">
@@ -588,11 +605,4 @@
<object class="GThemedIcon" id="icon-underline">
<property name="name">format-text-underline-symbolic</property>
</object>
- <object class="GtkSizeGroup">
- <property name="mode">horizontal</property>
- <widgets>
- <widget name="main"/>
- <widget name="submenu1"/>
- </widgets>
- </object>
</interface>
diff --git a/tests/testpopover.c b/tests/testpopover.c
index da6ae8c..306e7c9 100644
--- a/tests/testpopover.c
+++ b/tests/testpopover.c
@@ -30,39 +30,6 @@ static GActionEntry entries[] = {
{ "action10", activate, NULL, NULL, NULL }
};
-static void
-open_menu (GtkWidget *button, const gchar *name)
-{
- GtkWidget *stack;
- g_print ("open %s\n", name);
- stack = gtk_widget_get_ancestor (button, GTK_TYPE_STACK);
- gtk_stack_set_visible_child_name (GTK_STACK (stack), name);
-}
-
-void
-open_main (GtkWidget *button)
-{
- open_menu (button, "main");
-}
-
-void
-open_submenu1 (GtkWidget *button)
-{
- open_menu (button, "submenu1");
-}
-
-void
-open_submenu2 (GtkWidget *button)
-{
- open_menu (button, "submenu2");
-}
-
-void
-open_subsubmenu (GtkWidget *button)
-{
- open_menu (button, "subsubmenu");
-}
-
int
main (int argc, char *argv[])
{
@@ -124,7 +91,6 @@ main (int argc, char *argv[])
popover = GTK_WIDGET (gtk_menu_button_get_popover (GTK_MENU_BUTTON (button)));
builder = gtk_builder_new_from_file ("popover2.ui");
- gtk_builder_connect_signals (builder, NULL);
popover2 = (GtkWidget *)gtk_builder_get_object (builder, "popover");
gtk_menu_button_set_popover (GTK_MENU_BUTTON (button2), popover2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]