📄 glib-the-main-event-loop.html
字号:
<div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td> a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <code class="literal">TRUE</code> if the mainloop is currently being run.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849222"></a><h3><a name="g-main-loop-get-context"></a>g_main_loop_get_context ()</h3><a class="indexterm" name="id2849233"></a><pre class="programlisting"><a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* g_main_loop_get_context (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Returns the <a href="glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> of <em class="parameter"><code>loop</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td> a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> the <a href="glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> of <em class="parameter"><code>loop</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849330"></a><h3><a name="g-main-new"></a>g_main_new()</h3><a class="indexterm" name="id2849340"></a><pre class="programlisting">#define g_main_new(is_running)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_main_new</code> is deprecated and should not be used in newly-written code. Use <a href="glib-The-Main-Event-Loop.html#g-main-loop-new"><code class="function">g_main_loop_new()</code></a> instead.</p></div><p>Creates a new <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> for the default main loop. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>is_running</code></em> :</span></td><td>set to <code class="literal">TRUE</code> to indicate that the loop is running. This is notvery important since calling <a href="glib-The-Main-Event-Loop.html#g-main-run"><code class="function">g_main_run()</code></a> will set this to <code class="literal">TRUE</code> anyway.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>a new <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849446"></a><h3><a name="g-main-destroy"></a>g_main_destroy()</h3><a class="indexterm" name="id2849457"></a><pre class="programlisting">#define g_main_destroy(loop)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_main_destroy</code> is deprecated and should not be used in newly-written code. Use <a href="glib-The-Main-Event-Loop.html#g-main-loop-unref"><code class="function">g_main_loop_unref()</code></a> instead.</p></div><p>Frees the memory allocated for the <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td>a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849530"></a><h3><a name="g-main-run"></a>g_main_run()</h3><a class="indexterm" name="id2849540"></a><pre class="programlisting">#define g_main_run(loop)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_main_run</code> is deprecated and should not be used in newly-written code. Use <a href="glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</code></a> instead.</p></div><p>Runs a main loop until it stops running. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td>a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849605"></a><h3><a name="g-main-quit"></a>g_main_quit()</h3><a class="indexterm" name="id2849616"></a><pre class="programlisting">#define g_main_quit(loop)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_main_quit</code> is deprecated and should not be used in newly-written code. Use <a href="glib-The-Main-Event-Loop.html#g-main-loop-quit"><code class="function">g_main_loop_quit()</code></a> instead.</p></div><p>Stops the <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>. If <a href="glib-The-Main-Event-Loop.html#g-main-run"><code class="function">g_main_run()</code></a> was called to run the <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>,it will now return. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td>a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849706"></a><h3><a name="g-main-is-running"></a>g_main_is_running()</h3><a class="indexterm" name="id2849717"></a><pre class="programlisting">#define g_main_is_running(loop)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">g_main_is_running</code> is deprecated and should not be used in newly-written code. USe <a href="glib-The-Main-Event-Loop.html#g-main-loop-is-running"><code class="function">g_main_loop_is_running()</code></a> instead.</p></div><p>Checks if the main loop is running. </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>loop</code></em> :</span></td><td>a <a href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td><code class="literal">TRUE</code> if the main loop is running.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2849798"></a><h3><a name="G-PRIORITY-HIGH:CAPS"></a>G_PRIORITY_HIGH</h3><a class="indexterm" name="id2849809"></a><pre class="programlisting">#define G_PRIORITY_HIGH -100</pre><p>Use this for high priority event sources.It is not used within GLib or GTK+.</p></div><hr><div class="refsect2" lang="en"><a name="id2849826"></a><h3><a name="G-PRIORITY-DEFAULT:CAPS"></a>G_PRIORITY_DEFAULT</h3><a class="indexterm" name="id2849837"></a><pre class="programlisting">#define G_PRIORITY_DEFAULT 0</pre><p>Use this for default priority event sources.In GLib this priority is used when adding timeout functions with<a href="glib-The-Main-Event-Loop.html#g-timeout-add"><code class="function">g_timeout_add()</code></a>.In GDK this priority is used for events from the X server.</p></div><hr><div class="refsect2" lang="en"><a name="id2849866"></a><h3><a name="G-PRIORITY-HIGH-IDLE:CAPS"></a>G_PRIORITY_HIGH_IDLE</h3><a class="indexterm" name="id2849876"></a><pre class="programlisting">#define G_PRIORITY_HIGH_IDLE 100</pre><p>Use this for high priority idle functions.GTK+ uses <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS"><span class="type">G_PRIORITY_HIGH_IDLE</span></a> + 10 for resizing operations, and<a href="glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS"><span class="type">G_PRIORITY_HIGH_IDLE</span></a> + 20 for redrawing operations. (This is done toensure that any pending resizes are processed before any pending redraws,so that widgets are not redrawn twice unnecessarily.)</p></div><hr><div class="refsect2" lang="en"><a name="id2849914"></a><h3><a name="G-PRIORITY-DEFAULT-IDLE:CAPS"></a>G_PRIORITY_DEFAULT_IDLE</h3><a class="indexterm" name="id2849925"></a><pre class="programlisting">#define G_PRIORITY_DEFAULT_IDLE 200</pre><p>Use this for default priority idle functions.In GLib this priority is used when adding idle functions with <a href="glib-The-Main-Event-Loop.html#g-idle-add"><code class="function">g_idle_add()</code></a>.</p></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -