📄 gtktextview.html
字号:
<a name="gtk-text-view-get-buffer"></a>gtk_text_view_get_buffer ()</h3><a class="indexterm" name="id3647603"></a><pre class="programlisting"><a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer">GtkTextBuffer</a>* gtk_text_view_get_buffer (<a class="link" href="GtkTextView.html" title="GtkTextView">GtkTextView</a> *text_view);</pre><p>Returns the <a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer"><span class="type">GtkTextBuffer</span></a> being displayed by this text view.The reference count on the buffer is not incremented; the callerof this function won't own a new reference.</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>text_view</code></em> :</span></p></td><td> a <a class="link" href="GtkTextView.html" title="GtkTextView"><span class="type">GtkTextView</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer"><span class="type">GtkTextBuffer</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3647690"></a><h3><a name="gtk-text-view-scroll-to-mark"></a>gtk_text_view_scroll_to_mark ()</h3><a class="indexterm" name="id3647703"></a><pre class="programlisting">void gtk_text_view_scroll_to_mark (<a class="link" href="GtkTextView.html" title="GtkTextView">GtkTextView</a> *text_view, <a class="link" href="GtkTextMark.html" title="GtkTextMark">GtkTextMark</a> *mark, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> within_margin, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> use_align, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> xalign, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> yalign);</pre><p>Scrolls <em class="parameter"><code>text_view</code></em> so that <em class="parameter"><code>mark</code></em> is on the screen in the positionindicated by <em class="parameter"><code>xalign</code></em> and <em class="parameter"><code>yalign</code></em>. An alignment of 0.0 indicatesleft or top, 1.0 indicates right or bottom, 0.5 means center. If <em class="parameter"><code>use_align</code></em> is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size <em class="parameter"><code>within_margin</code></em>.</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>text_view</code></em> :</span></p></td><td> a <a class="link" href="GtkTextView.html" title="GtkTextView"><span class="type">GtkTextView</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>mark</code></em> :</span></p></td><td> a <a class="link" href="GtkTextMark.html" title="GtkTextMark"><span class="type">GtkTextMark</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>within_margin</code></em> :</span></p></td><td> margin as a [0.0,0.5) fraction of screen size</td></tr><tr><td><p><span class="term"><em class="parameter"><code>use_align</code></em> :</span></p></td><td> whether to use alignment arguments (if <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, just get the mark onscreen)</td></tr><tr><td><p><span class="term"><em class="parameter"><code>xalign</code></em> :</span></p></td><td> horizontal alignment of mark within visible area</td></tr><tr><td><p><span class="term"><em class="parameter"><code>yalign</code></em> :</span></p></td><td> vertical alignment of mark within visible area</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3647941"></a><h3><a name="gtk-text-view-scroll-to-iter"></a>gtk_text_view_scroll_to_iter ()</h3><a class="indexterm" name="id3647955"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_text_view_scroll_to_iter (<a class="link" href="GtkTextView.html" title="GtkTextView">GtkTextView</a> *text_view, <a class="link" href="gtk-GtkTextIter.html#GtkTextIter">GtkTextIter</a> *iter, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> within_margin, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> use_align, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> xalign, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble">gdouble</a> yalign);</pre><p>Scrolls <em class="parameter"><code>text_view</code></em> so that <em class="parameter"><code>iter</code></em> is on the screen in the positionindicated by <em class="parameter"><code>xalign</code></em> and <em class="parameter"><code>yalign</code></em>. An alignment of 0.0 indicatesleft or top, 1.0 indicates right or bottom, 0.5 means center. If <em class="parameter"><code>use_align</code></em> is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size <em class="parameter"><code>within_margin</code></em>.</p><p>Note that this function uses the currently-computed height of thelines in the text buffer. Line heights are computed in an idle handler; so this function may not have the desired effect if it's called before the height computations. To avoid oddness, consider using <a class="link" href="GtkTextView.html#gtk-text-view-scroll-to-mark"><code class="function">gtk_text_view_scroll_to_mark()</code></a> which saves a point to be scrolled to after line validation.</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>text_view</code></em> :</span></p></td><td> a <a class="link" href="GtkTextView.html" title="GtkTextView"><span class="type">GtkTextView</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td><td> a <a class="link" href="gtk-GtkTextIter.html#GtkTextIter"><span class="type">GtkTextIter</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>within_margin</code></em> :</span></p></td><td> margin as a [0.0,0.5) fraction of screen size</td></tr><tr><td><p><span class="term"><em class="parameter"><code>use_align</code></em> :</span></p></td><td> whether to use alignment arguments (if <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, just get the mark onscreen)</td></tr><tr><td><p><span class="term"><em class="parameter"><code>xalign</code></em> :</span></p></td><td> horizontal alignment of mark within visible area</td></tr><tr><td><p><span class="term"><em class="parameter"><code>yalign</code></em> :</span></p></td><td> vertical alignment of mark within visible area</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if scrolling occurred</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3648234"></a><h3><a name="gtk-text-view-scroll-mark-onscreen"></a>gtk_text_view_scroll_mark_onscreen ()</h3><a class="indexterm" name="id3648248"></a><pre class="programlisting">void gtk_text_view_scroll_mark_onscreen (<a class="link" href="GtkTextView.html" title="GtkTextView">GtkTextView</a> *text_view, <a class="link" href="GtkTextMark.html" title="GtkTextMark">GtkTextMark</a> *mark);</pre><p>Scrolls <em class="parameter"><code>text_view</code></em> the minimum distance such that <em class="parameter"><code>mark</code></em> is containedwithin the visible area of the widget.</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>text_view</code></em> :</span></p></td><td> a <a class="link" href="GtkTextView.html" title="GtkTextView"><span class="type">GtkTextView</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>mark</code></em> :</span></p></td><td> a mark in the buffer for <em class="parameter"><code>text_view</code></em></td></tr></tbody>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -