[gtk+/overlay: 15/34] overlay: do not set the offset in gtk_overlay_add
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 15/34] overlay: do not set the offset in gtk_overlay_add
- Date: Sat, 11 Jun 2011 00:59:55 +0000 (UTC)
commit bdca31dedc6dc985a8d1975a4d2a02be53be5810
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu May 26 23:17:47 2011 +0200
overlay: do not set the offset in gtk_overlay_add
demos/gtk-demo/overlay.c | 20 ++++++++++++--------
gtk/gtkoverlay.c | 12 +++---------
gtk/gtkoverlay.h | 4 +---
3 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c
index 0ab6528..078bfb7 100644
--- a/demos/gtk-demo/overlay.c
+++ b/demos/gtk-demo/overlay.c
@@ -43,44 +43,48 @@ do_overlay (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (window), overlay);
entry = gtk_entry_new ();
- gtk_overlay_add (GTK_OVERLAY (overlay), entry, 0, 0);
+ gtk_overlay_add (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, -20, -5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label);
+ gtk_overlay_set_offset (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);
+ gtk_overlay_add (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, 20, -5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label);
+ gtk_overlay_set_offset (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);
+ gtk_overlay_add (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, -20, 5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label);
+ gtk_overlay_set_offset (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);
+ gtk_overlay_add (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, 20, 5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label);
+ gtk_overlay_set_offset (GTK_OVERLAY (overlay), label, 20, 5);
gtk_widget_show_all (overlay);
}
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index ce88c0e..6373964 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -448,7 +448,7 @@ static void
overlay_add (GtkContainer *overlay,
GtkWidget *widget)
{
- gtk_overlay_add (GTK_OVERLAY (overlay), widget, 0, 0);
+ gtk_overlay_add (GTK_OVERLAY (overlay), widget);
}
static void
@@ -731,16 +731,12 @@ gtk_overlay_get_relative_widget (GtkOverlay *overlay)
* gtk_overlay_add:
* @overlay: a #GtkOverlay
* @widget: a #GtkWidget to be added to the container
- * @x_offset: x offset for @widget
- * @y_offset: y offset for @widget
*
- * Adds @widget to @overlay in a specific position.
+ * Adds @widget to @overlay.
*/
void
gtk_overlay_add (GtkOverlay *overlay,
- GtkWidget *widget,
- gint x_offset,
- gint y_offset)
+ GtkWidget *widget)
{
GtkOverlayChild *child;
@@ -750,8 +746,6 @@ gtk_overlay_add (GtkOverlay *overlay,
add_child (overlay, widget);
child = get_child (overlay, widget);
- child->x_offset = x_offset;
- child->y_offset = y_offset;
if (gtk_widget_get_realized (GTK_WIDGET (overlay)))
child->window = gtk_overlay_create_child_window (overlay, widget);
diff --git a/gtk/gtkoverlay.h b/gtk/gtkoverlay.h
index 5d52f6f..36d02dd 100644
--- a/gtk/gtkoverlay.h
+++ b/gtk/gtkoverlay.h
@@ -76,9 +76,7 @@ void gtk_overlay_set_relative_widget (GtkOverlay *overlay,
GtkWidget *gtk_overlay_get_relative_widget (GtkOverlay *overlay);
void gtk_overlay_add (GtkOverlay *overlay,
- GtkWidget *widget,
- gint x_offset,
- gint y_offset);
+ GtkWidget *widget);
void gtk_overlay_set_offset (GtkOverlay *overlay,
GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]