diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-02-10 00:39:49 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-02-10 00:39:49 +0000 |
commit | c3a4205cfaf1cbe1b299a3dc49bb2e1907d580de (patch) | |
tree | e76b008a3ef88ebe04c4deabaa33357483a467f3 /gtk/gtkentry.c | |
parent | 72d584389835b1f7de3dafd6b0fb0497c63646e3 (diff) | |
download | gtk+-c3a4205cfaf1cbe1b299a3dc49bb2e1907d580de.tar.gz |
Moved entry->visible into editable class. (Leave it behind deprecated for
Tue Feb 9 19:39:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.[ch] gtk/gtkeditable.h: Moved
entry->visible into editable class. (Leave it
behind deprecated for compatibility)
* gtk/gtkeditable.c: If not editable->visible,
return *'s for clipboard and selection.
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r-- | gtk/gtkentry.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 045566ac9d..642ea264e8 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -326,7 +326,7 @@ gtk_entry_get_arg (GtkObject *object, GTK_VALUE_UINT (*arg) = entry->text_max_length; break; case ARG_VISIBILITY: - GTK_VALUE_BOOL (*arg) = entry->visible; + GTK_VALUE_BOOL (*arg) = GTK_EDITABLE (entry)->visible; break; default: arg->type = GTK_TYPE_INVALID; @@ -460,7 +460,8 @@ gtk_entry_set_visibility (GtkEntry *entry, g_return_if_fail (entry != NULL); g_return_if_fail (GTK_IS_ENTRY (entry)); - entry->visible = visible; + entry->visible = visible ? TRUE : FALSE; + GTK_EDITABLE (entry)->visible = visible ? TRUE : FALSE; gtk_entry_recompute_offsets (entry); gtk_widget_queue_draw (GTK_WIDGET (entry)); } @@ -1344,8 +1345,8 @@ gtk_entry_draw_text (GtkEntry *entry) selection_end_xoffset = entry->char_offset[selection_end_pos] -entry->scroll_offset; - /* if entry->visible, print a bunch of stars. If not, print the standard text. */ - if (entry->visible) + /* if editable->visible, print a bunch of stars. If not, print the standard text. */ + if (editable->visible) { toprint = entry->text + start_pos; } @@ -1391,7 +1392,7 @@ gtk_entry_draw_text (GtkEntry *entry) toprint + selection_end_pos - start_pos, end_pos - selection_end_pos); /* free the space allocated for the stars if it's neccessary. */ - if (!entry->visible) + if (!editable->visible) g_free (toprint); if (editable->editable) @@ -1725,7 +1726,7 @@ gtk_entry_insert_text (GtkEditable *editable, for (i=start_pos; i<end_pos; i++) { entry->char_offset[i] = entry->char_offset[start_pos] + offset; - if (entry->visible) + if (editable->visible) { offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font, entry->text[i]); @@ -1756,7 +1757,7 @@ gtk_entry_recompute_offsets (GtkEntry *entry) for (i=0; i<entry->text_length; i++) { entry->char_offset[i] = offset; - if (entry->visible) + if (GTK_EDITABLE (entry)->visible) { offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font, entry->text[i]); |