[gtk+/overlay: 10/34] overlay: add labels over entries in the demo
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 10/34] overlay: add labels over entries in the demo
- Date: Sat, 11 Jun 2011 00:59:29 +0000 (UTC)
commit 286b1efb8f6dd0720c4cb7d1f9069c1f865b57b5
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu May 26 22:00:47 2011 +0200
overlay: add labels over entries in the demo
demos/gtk-demo/overlay.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c
index 7449a58..2c901e4 100644
--- a/demos/gtk-demo/overlay.c
+++ b/demos/gtk-demo/overlay.c
@@ -1,4 +1,6 @@
/* Overlay
+ *
+ * Stack widgets in static positions over a main widget
*/
#include <gtk/gtk.h>
@@ -14,6 +16,7 @@ do_overlay (GtkWidget *do_widget)
GtkWidget *sw;
GtkWidget *overlay;
GtkWidget *entry;
+ GtkWidget *label;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
@@ -43,21 +46,41 @@ do_overlay (GtkWidget *do_widget)
gtk_widget_set_halign (entry, GTK_ALIGN_END);
gtk_widget_set_valign (entry, GTK_ALIGN_END);
+ label = gtk_label_new ("Hello world");
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
+ gtk_widget_set_valign (label, GTK_ALIGN_END);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
gtk_widget_set_valign (entry, GTK_ALIGN_END);
gtk_overlay_add (GTK_OVERLAY (overlay), entry, 0, 0);
+ label = gtk_label_new ("Hello world");
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_END);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_END);
gtk_widget_set_valign (entry, GTK_ALIGN_START);
gtk_overlay_add (GTK_OVERLAY (overlay), entry, 0, 0);
+ label = gtk_label_new ("Hello world");
+ gtk_widget_set_halign (label, GTK_ALIGN_END);
+ gtk_widget_set_valign (label, GTK_ALIGN_START);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
gtk_widget_set_valign (entry, GTK_ALIGN_START);
gtk_overlay_add (GTK_OVERLAY (overlay), entry, 0, 0);
+ label = gtk_label_new ("Hello world");
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_START);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+
gtk_widget_show_all (overlay);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]