?? glib-the-main-event-loop.html
字號:
<tbody><tr><td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td><td> a <a class="link" href="glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> (if <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the default context will be used).</td></tr><tr><td><p><span class="term"><em class="parameter"><code>is_running</code></em> :</span></p></td><td> set to <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to indicate that the loop is running. Thisis not very important since calling <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</code></a> will set this to<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> anyway.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" 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="id2857182"></a><h3><a name="g-main-loop-ref"></a>g_main_loop_ref ()</h3><a class="indexterm" name="id2857195"></a><pre class="programlisting"><a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a>* g_main_loop_ref (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Increases the reference count on a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> object by one.</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>loop</code></em> :</span></p></td><td> a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <em class="parameter"><code>loop</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2857276"></a><h3><a name="g-main-loop-unref"></a>g_main_loop_unref ()</h3><a class="indexterm" name="id2857290"></a><pre class="programlisting">void g_main_loop_unref (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Decreases the reference count on a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> object by one. Ifthe result is zero, free the loop and free all associated memory.</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>loop</code></em> :</span></p></td><td> a <a class="link" 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="id2857357"></a><h3><a name="g-main-loop-run"></a>g_main_loop_run ()</h3><a class="indexterm" name="id2857370"></a><pre class="programlisting">void g_main_loop_run (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Runs a main loop until <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-quit"><code class="function">g_main_loop_quit()</code></a> is called on the loop.If this is called for the thread of the loop's <a class="link" href="glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a>,it will process events from the loop, otherwise it willsimply wait.</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>loop</code></em> :</span></p></td><td> a <a class="link" 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="id2857448"></a><h3><a name="g-main-loop-quit"></a>g_main_loop_quit ()</h3><a class="indexterm" name="id2857461"></a><pre class="programlisting">void g_main_loop_quit (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Stops a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> from running. Any calls to <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</code></a>for the loop will return. </p><p>Note that sources that have already been dispatched when <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-quit"><code class="function">g_main_loop_quit()</code></a> is called will still be executed.</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>loop</code></em> :</span></p></td><td> a <a class="link" 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="id2857554"></a><h3><a name="g-main-loop-is-running"></a>g_main_loop_is_running ()</h3><a class="indexterm" name="id2857566"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_main_loop_is_running (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Checks to see if the main loop is currently being run via <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-run"><code class="function">g_main_loop_run()</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>loop</code></em> :</span></p></td><td> a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the mainloop is currently being run.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2857656"></a><h3><a name="g-main-loop-get-context"></a>g_main_loop_get_context ()</h3><a class="indexterm" name="id2857669"></a><pre class="programlisting"><a class="link" href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* g_main_loop_get_context (<a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);</pre><p>Returns the <a class="link" 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><p><span class="term"><em class="parameter"><code>loop</code></em> :</span></p></td><td> a <a class="link" href="glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the <a class="link" 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="id2857766"></a><h3><a name="g-main-new"></a>g_main_new()</h3><a class="indexterm" name="id2857781"></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> has been deprecated since version 2.2 and should not be used in newly-written code. Use <a class="link" href="glib-The-Main-Event-Loop.html#g-main-loop-new"><code class="function">g_main_loop_new()</code></a> instead.</p>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -