1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GtkEditable
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2004-10-11 18:08:35 +00:00
|
|
|
Interface for text-editing widgets
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2002-12-10 23:25:33 +00:00
|
|
|
The #GtkEditable interface is an interface which should be implemented by
|
|
|
|
text editing widgets, such as #GtkEntry and #GtkText. It contains functions
|
|
|
|
for generically manipulating an editable widget, a large number of action
|
|
|
|
signals used for key bindings, and several signals that an application can
|
|
|
|
connect to to modify the behavior of a widget.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
As an example of the latter usage, by connecting
|
|
|
|
the following handler to "insert_text", an application
|
|
|
|
can convert all entry into a widget into uppercase.
|
|
|
|
|
|
|
|
<example>
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
<title>Forcing entry to uppercase.</title>
|
1999-08-16 18:51:52 +00:00
|
|
|
<programlisting>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
insert_text_handler (GtkEditable *editable,
|
|
|
|
const gchar *text,
|
|
|
|
gint length,
|
|
|
|
gint *position,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
int i;
|
2004-06-22 16:06:44 +00:00
|
|
|
gchar *result = g_utf8_strup (text, length);
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2004-04-23 19:48:08 +00:00
|
|
|
g_signal_handlers_block_by_func (editable,
|
|
|
|
(gpointer) insert_text_handler, data);
|
1999-08-16 18:51:52 +00:00
|
|
|
gtk_editable_insert_text (editable, result, length, position);
|
2004-04-23 19:48:08 +00:00
|
|
|
g_signal_handlers_unblock_by_func (editable,
|
|
|
|
(gpointer) insert_text_handler, data);
|
1999-08-16 18:51:52 +00:00
|
|
|
|
2004-04-23 19:48:08 +00:00
|
|
|
g_signal_stop_emission_by_name (editable, "insert_text");
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
g_free (result);
|
|
|
|
}
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-06-20 22:06:27 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
<!-- ##### SECTION Image ##### -->
|
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### STRUCT GtkEditable ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
The #GtkEditable structure is an opaque structure whose members
|
|
|
|
cannot be directly accessed.
|
2004-07-20 02:26:06 +00:00
|
|
|
</para>
|
|
|
|
|
2009-01-01 22:24:56 +00:00
|
|
|
|
|
|
|
<!-- ##### SIGNAL GtkEditable::changed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
@editable: the object which received the signal.
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GtkEditable::delete-text ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@start_pos:
|
|
|
|
@end_pos:
|
2004-07-20 02:26:06 +00:00
|
|
|
|
|
|
|
<!-- ##### SIGNAL GtkEditable::insert-text ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
2004-07-20 02:26:06 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
2009-01-01 22:24:56 +00:00
|
|
|
@new_text:
|
|
|
|
@new_text_length:
|
|
|
|
@position:
|
2004-07-20 02:26:06 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_editable_select_region ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
2009-01-01 22:24:56 +00:00
|
|
|
@start_pos:
|
|
|
|
@end_pos:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2000-11-14 16:36:20 +00:00
|
|
|
<!-- ##### FUNCTION gtk_editable_get_selection_bounds ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
2000-11-14 16:36:20 +00:00
|
|
|
</para>
|
|
|
|
|
2009-01-01 22:24:56 +00:00
|
|
|
@editable:
|
|
|
|
@start_pos:
|
|
|
|
@end_pos:
|
|
|
|
@Returns:
|
2000-11-14 16:36:20 +00:00
|
|
|
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### FUNCTION gtk_editable_insert_text ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@new_text:
|
|
|
|
@new_text_length:
|
|
|
|
@position:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_delete_text ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@start_pos:
|
|
|
|
@end_pos:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_get_chars ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@start_pos:
|
|
|
|
@end_pos:
|
|
|
|
@Returns:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_cut_clipboard ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2009-01-01 22:24:56 +00:00
|
|
|
@editable:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_copy_clipboard ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_paste_clipboard ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_delete_selection ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_set_position ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@position:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_get_position ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
|
|
|
@Returns:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_editable_set_editable ##### -->
|
|
|
|
<para>
|
2008-12-28 18:57:44 +00:00
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2008-12-28 18:57:44 +00:00
|
|
|
@editable:
|
2009-01-01 22:24:56 +00:00
|
|
|
@is_editable:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2001-09-08 06:24:46 +00:00
|
|
|
<!-- ##### FUNCTION gtk_editable_get_editable ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@editable:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|