[gtk+] entry: Fix gtk_entry_get_icon_at_pos()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: Fix gtk_entry_get_icon_at_pos()
- Date: Sat, 16 Apr 2011 20:43:16 +0000 (UTC)
commit 1351d40cfe0df7e1d12017af4323fb3ab73b19d2
Author: Benjamin Otte <otte redhat com>
Date: Sat Apr 16 21:59:36 2011 +0200
entry: Fix gtk_entry_get_icon_at_pos()
The passed in coordinates are widget-relative, not window-relative.
gtk/gtkentry.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f3eb37a..0c5fd5e 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -8267,10 +8267,11 @@ gtk_entry_get_icon_storage_type (GtkEntry *entry,
/**
* gtk_entry_get_icon_at_pos:
* @entry: a #GtkEntry
- * @x: the x coordinate of the position to find
+ * @x: the x coordinate of the position to fine
* @y: the y coordinate of the position to find
*
- * Finds the icon at the given position and return its index.
+ * Finds the icon at the given position and return its index. The
+ * position's coordinates are relative to the @entry's top left corner.
* If @x, @y doesn't lie inside an icon, -1 is returned.
* This function is intended for use in a #GtkWidget::query-tooltip
* signal handler.
@@ -8290,7 +8291,7 @@ gtk_entry_get_icon_at_pos (GtkEntry *entry,
g_return_val_if_fail (GTK_IS_ENTRY (entry), -1);
- get_frame_size (entry, TRUE, &frame_x, &frame_y, NULL, NULL);
+ get_frame_size (entry, FALSE, &frame_x, &frame_y, NULL, NULL);
x -= frame_x;
y -= frame_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]