Adapt the testpopover example

We now use GtkPopoverMenu, and just add the model buttons
directly to it.
This commit is contained in:
Matthias Clasen 2014-10-23 23:39:39 -04:00
parent e095918128
commit 4da281d20b
3 changed files with 575 additions and 603 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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);