forked from AuroraMiddleware/gtk
Adapt the testpopover example
We now use GtkPopoverMenu, and just add the model buttons directly to it.
This commit is contained in:
parent
e095918128
commit
4da281d20b
@ -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
|
||||
|
1138
tests/popover2.ui
1138
tests/popover2.ui
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user