📄 gtkeditable.html
字号:
</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24736"></A><H3><ANAME="GTK-EDITABLE-CLAIM-SELECTION"></A>gtk_editable_claim_selection ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_editable_claim_selection (<AHREF="gtkeditable.html">GtkEditable</A> *editable, <AHREF=../glib/glib-basic-types.html#GBOOLEAN>gboolean</A> claim, <AHREF=../glib/glib-basic-types.html#GUINT32>guint32</A> time);</PRE></TD></TR></TABLE><P>Claim or disclaim ownership of the PRIMARY X selection.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24744"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>claim</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">if <TTCLASS="LITERAL">TRUE</TT>, claim the selection, otherwise, disclaim it.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>time</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the timestamp for claiming the selection. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24763"></A><H3><ANAME="GTK-EDITABLE-DELETE-SELECTION"></A>gtk_editable_delete_selection ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_editable_delete_selection (<AHREF="gtkeditable.html">GtkEditable</A> *editable);</PRE></TD></TR></TABLE><P>Deletes the current contents of the widgets selection anddisclaims the selection.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24769"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24779"></A><H3><ANAME="GTK-EDITABLE-CHANGED"></A>gtk_editable_changed ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_editable_changed (<AHREF="gtkeditable.html">GtkEditable</A> *editable);</PRE></TD></TR></TABLE><P>Causes the "changed" signal to be emitted.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24785"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24795"></A><H3><ANAME="GTK-EDITABLE-SET-POSITION"></A>gtk_editable_set_position ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_editable_set_position (<AHREF="gtkeditable.html">GtkEditable</A> *editable, <AHREF=../glib/glib-basic-types.html#GINT>gint</A> position);</PRE></TD></TR></TABLE><P>Sets the cursor position.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24802"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>position</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the position of the cursor. The cursor is displayed before the character with the given (base 0) index in the widget. The value must be less than or equal to the number of characters in the widget. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24816"></A><H3><ANAME="GTK-EDITABLE-GET-POSITION"></A>gtk_editable_get_position ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF=../glib/glib-basic-types.html#GINT>gint</A> gtk_editable_get_position (<AHREF="gtkeditable.html">GtkEditable</A> *editable);</PRE></TD></TR></TABLE><P>Retrieves the current cursor position.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24823"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the position of the cursor. The cursor is displayed before the character with the given (base 0) index in the widget. The value will be less than or equal to the number of characters in the widget. Note that this position is in characters, not in bytes. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24837"></A><H3><ANAME="GTK-EDITABLE-SET-EDITABLE"></A>gtk_editable_set_editable ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_editable_set_editable (<AHREF="gtkeditable.html">GtkEditable</A> *editable, <AHREF=../glib/glib-basic-types.html#GBOOLEAN>gboolean</A> is_editable);</PRE></TD></TR></TABLE><P>Determines if the user can edit the text in the editablewidget or not.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24844"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a <AHREF="gtkeditable.html">GtkEditable</A> widget.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>is_editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"><TTCLASS="LITERAL">TRUE</TT> if the user is allowed to edit the text in the widget. </TD></TR></TBODY></TABLE><P></P></DIV></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN24859"></A><H2>Args</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT><ANAME="GTKEDITABLE--TEXT-POSITION"></A>"<TTCLASS="LITERAL">text-position</TT>" (<AHREF=../glib/glib-basic-types.html#GINT>gint</A> : Read / Write)</DT><DD><P></P></DD><DT><ANAME="GTKEDITABLE--EDITABLE"></A>"<TTCLASS="LITERAL">editable</TT>" (<AHREF=../glib/glib-basic-types.html#GBOOLEAN>gboolean</A> : Read / Write)</DT><DD><P>A boolean indicating whether the widget is editable bythe user.</P></DD></DL></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN24876"></A><H2>Signals</H2><DIVCLASS="REFSECT2"><ANAME="AEN24878"></A><H3><ANAME="GTKEDITABLE-CHANGED"></A>The "changed" signal</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void user_function (<AHREF="gtkeditable.html">GtkEditable</A> *editable, <AHREF=../glib/glib-basic-types.html#GPOINTER>gpointer</A> user_data);</PRE></TD></TR></TABLE><P>Indicates that the user has changed the contentsof the widget.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24885"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object which received the signal. </TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>user_data</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">user data set when the signal handler was connected.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN24898"></A><H3><ANAME="GTKEDITABLE-INSERT-TEXT"></A>The "insert-text" signal</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void user_function (<AHREF="gtkeditable.html">GtkEditable</A> *editable, <AHREF=../glib/glib-basic-types.html#GCHAR>gchar</A> *new_text, <AHREF=../glib/glib-basic-types.html#GINT>gint</A> new_text_length, <AHREF=../glib/glib-basic-types.html#GINT>gint</A> *position, <AHREF=../glib/glib-basic-types.html#GPOINTER>gpointer</A> user_data);</PRE></TD></TR></TABLE><P>This signal is emitted when text is inserted intothe widget by the user. The default handler forthis signal will normally be responsible for insertingthe text, so by connecting to this signal and thenstopping the signal with <AHREF="gtk-signals.html#GTK-SIGNAL-EMIT-STOP">gtk_signal_emit_stop</A>(), itis possible to modify the inserted text, or preventit from being inserted entirely.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN24909"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>editable</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the object which received the signal.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>new_text</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the new text to insert.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>new_text_length</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the length of the new text.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>position</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">the position at which to insert the new text. this is an in-out paramter. After the signal emission is finished, it should point after the newly inserted text. </TD></TR><TR><TD
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -