diff options
author | Michael Meeks <michael@ximian.com> | 2001-10-18 00:53:04 +0000 |
---|---|---|
committer | Michael Meeks <michael@src.gnome.org> | 2001-10-18 00:53:04 +0000 |
commit | bf8e23e34967976c465d02e0bd136fe9d648aa7e (patch) | |
tree | 9d2ebc98500ca1275a478901ef979629754b200b | |
parent | a8fb1cf162ecd89e09c90a4df4c1bbbf8f0b76c5 (diff) | |
download | gtk+-bf8e23e34967976c465d02e0bd136fe9d648aa7e.tar.gz |
impl 'text' (gtk_entry_class_init): add the 'text' prop.
2001-10-18 Michael Meeks <michael@ximian.com>
* gtk/gtkentry.c (gtk_entry_set_property),
(gtk_entry_get_property): impl 'text'
(gtk_entry_class_init): add the 'text' prop.
(gtk_entry_insert_text): notify 'text' changed.
(gtk_entry_delete_text): ditto.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 8 | ||||
-rw-r--r-- | gtk/gtkentry.c | 22 |
8 files changed, 75 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8daf939591..a4ac3b7525 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2001-10-18 Michael Meeks <michael@ximian.com> + + * gtk/gtkentry.c (gtk_entry_set_property), + (gtk_entry_get_property): impl 'text' + (gtk_entry_class_init): add the 'text' prop. + (gtk_entry_insert_text): notify 'text' changed. + (gtk_entry_delete_text): ditto. + 2001-10-17 Matthias Clasen <matthiasc@poet.de> * gtk/gtkdnd.c, gtk/gtkclipboard.c, gdk/x11/gdkmain-x11.c: diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 1529b32d15..bebc072516 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -78,7 +78,8 @@ enum { PROP_INVISIBLE_CHAR, PROP_ACTIVATES_DEFAULT, PROP_WIDTH_CHARS, - PROP_SCROLL_OFFSET + PROP_SCROLL_OFFSET, + PROP_TEXT }; static guint signals[LAST_SIGNAL] = { 0 }; @@ -465,7 +466,6 @@ gtk_entry_class_init (GtkEntryClass *class) _("Number of characters to leave space for in the entry."), -1, G_MAXINT, - -1, G_PARAM_READABLE | G_PARAM_WRITABLE)); @@ -476,9 +476,16 @@ gtk_entry_class_init (GtkEntryClass *class) _("Number of pixels of the entry scrolled off the screen to the left"), 0, G_MAXINT, - 0, G_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_TEXT, + g_param_spec_string ("text", + _("Text"), + _("The contents of the entry"), + "", + G_PARAM_READABLE | G_PARAM_WRITABLE)); gtk_widget_class_install_style_property (widget_class, g_param_spec_boxed ("cursor_color", @@ -809,6 +816,10 @@ gtk_entry_set_property (GObject *object, gtk_entry_set_width_chars (entry, g_value_get_int (value)); break; + case PROP_TEXT: + gtk_entry_set_text (entry, g_value_get_string (value)); + break; + case PROP_SCROLL_OFFSET: default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -855,6 +866,9 @@ gtk_entry_get_property (GObject *object, case PROP_SCROLL_OFFSET: g_value_set_int (value, entry->scroll_offset); break; + case PROP_TEXT: + g_value_set_string (value, gtk_entry_get_text (entry)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -1656,6 +1670,7 @@ gtk_entry_insert_text (GtkEditable *editable, g_signal_emit_by_name (editable, "insert_text", text, new_text_length, position); g_signal_emit_by_name (editable, "changed"); + g_object_notify (G_OBJECT (editable), "text"); if (new_text_length > 63) g_free (text); @@ -1681,6 +1696,7 @@ gtk_entry_delete_text (GtkEditable *editable, g_signal_emit_by_name (editable, "delete_text", start_pos, end_pos); g_signal_emit_by_name (editable, "changed"); + g_object_notify (G_OBJECT (editable), "text"); g_object_unref (G_OBJECT (editable)); } |