Commit 4da281d2 authored by Matthias Clasen's avatar Matthias Clasen

Adapt the testpopover example

We now use GtkPopoverMenu, and just add the model buttons
directly to it.
parent e0959181
...@@ -9,8 +9,7 @@ AM_CPPFLAGS = \ ...@@ -9,8 +9,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/gdk \ -I$(top_srcdir)/gdk \
$(GTK_DEBUG_FLAGS) \ $(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS) \ $(GTK_DEP_CFLAGS) \
$(GDK_DEP_CFLAGS) \ $(GDK_DEP_CFLAGS)
-pthread
DEPS = \ DEPS = \
$(top_builddir)/gtk/libgtk-3.la $(top_builddir)/gtk/libgtk-3.la
...@@ -20,11 +19,8 @@ LDADD = \ ...@@ -20,11 +19,8 @@ LDADD = \
$(top_builddir)/gdk/libgdk-3.la \ $(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS) \ $(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \ $(GDK_DEP_LIBS) \
-lgmodule-2.0 \
-lm -lm
AM_LDFLAGS = -Wl,--export-dynamic -pthread
if USE_X11 if USE_X11
testsocket_programs = testsocket testsocket_child testsocket_programs = testsocket testsocket_child
......
This diff is collapsed.
...@@ -30,39 +30,6 @@ static GActionEntry entries[] = { ...@@ -30,39 +30,6 @@ static GActionEntry entries[] = {
{ "action10", activate, NULL, NULL, NULL } { "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 int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
...@@ -124,7 +91,6 @@ 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))); popover = GTK_WIDGET (gtk_menu_button_get_popover (GTK_MENU_BUTTON (button)));
builder = gtk_builder_new_from_file ("popover2.ui"); builder = gtk_builder_new_from_file ("popover2.ui");
gtk_builder_connect_signals (builder, NULL);
popover2 = (GtkWidget *)gtk_builder_get_object (builder, "popover"); popover2 = (GtkWidget *)gtk_builder_get_object (builder, "popover");
gtk_menu_button_set_popover (GTK_MENU_BUTTON (button2), popover2); gtk_menu_button_set_popover (GTK_MENU_BUTTON (button2), popover2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment