[gtk+/overlay] overlay: update the gtk3-demo example
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay] overlay: update the gtk3-demo example
- Date: Sun, 12 Jun 2011 03:28:01 +0000 (UTC)
commit cd54652703a73485b8fc28c73fa1d6ba6bbc0d58
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 11 23:27:14 2011 -0400
overlay: update the gtk3-demo example
demos/gtk-demo/overlay.c | 78 +++++++++++++++++++++++++++++----------------
1 files changed, 50 insertions(+), 28 deletions(-)
---
diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c
index 297555e..cbddd93 100644
--- a/demos/gtk-demo/overlay.c
+++ b/demos/gtk-demo/overlay.c
@@ -40,107 +40,129 @@ do_overlay (GtkWidget *do_widget)
overlay = gtk_overlay_new ();
gtk_container_add (GTK_CONTAINER (overlay), sw);
- gtk_overlay_set_relative_widget (GTK_OVERLAY (overlay), view);
gtk_container_add (GTK_CONTAINER (window), overlay);
entry = gtk_entry_new ();
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
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);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, -20, -5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 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);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
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);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 20, -5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 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);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
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);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, -20, 5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 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);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
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);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 20, 5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_END);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), label);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, -20, 0);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), label);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 20, 0);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_CENTER);
gtk_widget_set_valign (entry, GTK_ALIGN_START);
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_widget_set_valign (label, GTK_ALIGN_START);
- gtk_overlay_add (GTK_OVERLAY (overlay), label);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 10, 5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 20);
+ gtk_widget_set_margin_right (label, 20);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_CENTER);
gtk_widget_set_valign (entry, GTK_ALIGN_END);
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_widget_set_valign (label, GTK_ALIGN_END);
- gtk_overlay_add (GTK_OVERLAY (overlay), label);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 10, -5);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
+ gtk_widget_set_margin_left (label, 10);
+ gtk_widget_set_margin_right (label, 10);
+ gtk_widget_set_margin_top (label, 5);
+ gtk_widget_set_margin_bottom (label, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_CENTER);
gtk_widget_set_valign (entry, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), entry);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry);
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_overlay_add (GTK_OVERLAY (overlay), label);
- gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 0, 0);
+ gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label);
gtk_widget_show_all (overlay);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]