Re: gtk_editable documentation?




Richard <rruth@studio.disney.com> writes:

> Where is the documentation on gtk_editable, gtk_editable_select_region
> etc. ??  I have been looking in the info pages that come with
> gtk+-0.99.8 and can not find anything on gtk_editable. 
> (gtkeditable.c has almost no comments).

I suspect the volunteers haven't gotten around to adding it to the
info pages yet, because it is pretty new.

Brief description:

Two signals:

 "activate" - triggered when the user hits "return" in an Entry,
              or Ctrl-Return in a Text widget
 "changed" - When the user changes the text

Two interesting functions:

void       gtk_editable_select_region  (GtkEditable      *editable,
					gint              start,
					gint              end);

Select a given region of the editable widget. (start <= char_pos < end)

gchar *    gtk_editable_get_chars      (GtkEditable      *editable,
					gint              start_pos,
					gint              end_pos);

Get a given region of the text (it is copied into a newly g_malloc'd
buffer, you must free it).

For both functions, the value end_pos == -1, has the meaning -
"to the end".

========

Other Functions:

guint      gtk_editable_get_type       (void);

standard func.

void       gtk_editable_insert_text   (GtkEditable       *editable,
					const gchar      *new_text,
					gint              new_text_length,
					gint             *position);
void       gtk_editable_delete_text    (GtkEditable      *editable,
					gint              start_pos,
					gint              end_pos);

Insert and delete text, as if the user did it. ("changed" is emitted)
(For "insert", position is in-out; after return it will reflect
the position after the inserted text)

You probably should use the Entry or Text specific functions instead.

void       gtk_editable_cut_clipboard  (GtkEditable      *editable,
					guint32           time);
void       gtk_editable_copy_clipboard (GtkEditable      *editable, 
					guint32           time);
void       gtk_editable_paste_clipboard (GtkEditable     *editable, 
					 guint32          time);
void       gtk_editable_claim_selection (GtkEditable     *editable, 
					 gboolean         claim, 
					 guint32          time);
void       gtk_editable_delete_selection (GtkEditable    *editable);

Operations on the selection. Mostly meant for use by descendants
of Editable (Text + Entry now) rather than for apps

void       gtk_editable_changed         (GtkEditable    *editable);

Emit the changed signal.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]