gtkentry.html

来自「最新gtk中文资料集」· HTML 代码 · 共 1,305 行 · 第 1/5 页

HTML
1,305
字号
<td>  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></div></div><hr><div class="refsect2" lang="en"><a name="id3520327"></a><h3><a name="gtk-entry-get-text"></a>gtk_entry_get_text ()</h3><a class="indexterm" name="id3520340"></a><pre class="programlisting">const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a>*        gtk_entry_get_text                  (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry);</pre><p>Retrieves the contents of the entry widget.See also <a class="link" href="GtkEditable.html#gtk-editable-get-chars"><code class="function">gtk_editable_get_chars()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> a pointer to the contents of the widget as a     string. This string points to internally allocated     storage in the widget and must not be freed, modified or     stored.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3520424"></a><h3><a name="gtk-entry-select-region"></a>gtk_entry_select_region ()</h3><a class="indexterm" name="id3520440"></a><pre class="programlisting">void                gtk_entry_select_region             (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> start,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> end);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_entry_select_region</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GtkEditable.html#gtk-editable-select-region"><code class="function">gtk_editable_select_region()</code></a> instead.</p></div><p>Selects a region of text. The characters that are selected are those characters at positions from <em class="parameter"><code>start_pos</code></em> up to, but not including <em class="parameter"><code>end_pos</code></em>. If <em class="parameter"><code>end_pos</code></em> is negative, then the the characters selected will be those characters from <em class="parameter"><code>start_pos</code></em> to the end of the text.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>start</code></em>&#160;:</span></p></td><td> the starting position</td></tr><tr><td><p><span class="term"><em class="parameter"><code>end</code></em>&#160;:</span></p></td><td> the end position</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3520593"></a><h3><a name="gtk-entry-set-visibility"></a>gtk_entry_set_visibility ()</h3><a class="indexterm" name="id3520606"></a><pre class="programlisting">void                gtk_entry_set_visibility            (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> visible);</pre><p>Sets whether the contents of the entry are visible or not. When visibility is set to <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere.</p><p>The default invisible char is the asterisk '*', but it canbe changed with <a class="link" href="GtkEntry.html#gtk-entry-set-invisible-char"><code class="function">gtk_entry_set_invisible_char()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>visible</code></em>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the contents of the entry are displayed          as plaintext</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3520726"></a><h3><a name="gtk-entry-set-invisible-char"></a>gtk_entry_set_invisible_char ()</h3><a class="indexterm" name="id3520739"></a><pre class="programlisting">void                gtk_entry_set_invisible_char        (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Unicode-Manipulation.html#gunichar">gunichar</a> ch);</pre><p>Sets the character to use in place of the actual text when<a class="link" href="GtkEntry.html#gtk-entry-set-visibility"><code class="function">gtk_entry_set_visibility()</code></a> has been called to set text visibilityto <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. i.e. this is the character used in "password mode" toshow the user how many characters have been typed. The defaultinvisible char is an asterisk ('*').  If you set the invisible charto 0, then the user will get no feedback at all; there will beno text on the screen as they type.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>ch</code></em>&#160;:</span></p></td><td> a Unicode character</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3520846"></a><h3><a name="gtk-entry-set-editable"></a>gtk_entry_set_editable ()</h3><a class="indexterm" name="id3520862"></a><pre class="programlisting">void                gtk_entry_set_editable              (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> editable);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_entry_set_editable</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GtkEditable.html#gtk-editable-set-editable"><code class="function">gtk_editable_set_editable()</code></a> instead.</p></div><p>Determines if the user can edit the text in the editablewidget or not.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>editable</code></em>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the user is allowed to edit the text  in the widget</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3520978"></a><h3><a name="gtk-entry-set-max-length"></a>gtk_entry_set_max_length ()</h3><a class="indexterm" name="id3520991"></a><pre class="programlisting">void                gtk_entry_set_max_length            (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> max);</pre><p>Sets the maximum allowed length of the contents of the widget. Ifthe current contents are longer than the given length, then theywill be truncated to fit.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>max</code></em>&#160;:</span></p></td><td> the maximum length of the entry, or 0 for no maximum.  (other than the maximum length of entries.) The value passed in will  be clamped to the range 0-65536.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3521075"></a><h3><a name="gtk-entry-get-activates-default"></a>gtk_entry_get_activates_default ()</h3><a class="indexterm" name="id3521088"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_entry_get_activates_default     (<a class="link" href="GtkEntry.html" title="GtkEntry">GtkEntry</a> *entry);</pre><p>Retrieves the value set by <a class="link" href="GtkEntry.html#gtk-entry-set-activates-default"><code class="function">gtk_entry_set_activates_default()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>entry</code></em>&#160;:</span></p></td><td> a <a class="link" href="GtkEntry.html" title="GtkEntry"><span class="type">GtkEntry</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the entry will activate the default widget</td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?