[gtk+] gdkgears: Add a popover
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdkgears: Add a popover
- Date: Wed, 26 Aug 2015 22:28:01 +0000 (UTC)
commit 0f1c4a303e76502fd94c6a9f7fda77141f47b91e
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 26 18:26:56 2015 -0400
gdkgears: Add a popover
As pointed out in bug 754143, this reveals a crash in the Wayland
backend.
tests/gdkgears.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/tests/gdkgears.c b/tests/gdkgears.c
index d9114df..f6d5bc0 100644
--- a/tests/gdkgears.c
+++ b/tests/gdkgears.c
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
{
GtkWidget *window, *box, *hbox, *button, *spinner, *check,
*fps_label, *gears, *extra_hbox, *bbox, *overlay,
- *revealer, *frame, *label, *scrolled;
+ *revealer, *frame, *label, *scrolled, *popover;
int i;
gtk_init (&argc, &argv);
@@ -200,6 +200,16 @@ main (int argc, char *argv[])
gtk_widget_show (check);
g_signal_connect (check, "toggled",
G_CALLBACK (toggle_overlay), revealer);
+ button = gtk_menu_button_new ();
+ gtk_menu_button_set_direction (GTK_MENU_BUTTON (button), GTK_ARROW_UP);
+ popover = gtk_popover_new (NULL);
+ gtk_container_set_border_width (GTK_CONTAINER (popover), 10);
+ label = gtk_label_new ("Popovers work too!");
+ gtk_widget_show (label);
+ gtk_container_add (GTK_CONTAINER (popover), label);
+ gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), popover);
+ gtk_widget_show (button);
+ gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]