<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>The Main Event Loop</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-core.html" title="GLib Core Application Support">
<link rel="prev" href="glib-core.html" title="GLib Core Application Support">
<link rel="next" href="glib-Threads.html" title="Threads">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-core.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Threads.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2880193" class="shortcut">Top</a>
 | 
<a href="#id2882293" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-The-Main-Event-Loop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2880193"></a><span class="refentrytitle">The Main Event Loop</span>
</h2>
<p>The Main Event Loop — manages all available sources of events.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <glib.h>
<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a>;
<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a>* <a href="glib-The-Main-Event-Loop.html#g-main-loop-new">g_main_loop_new</a> (<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a> *context,
<a href="glib-Basic-Types.html#gboolean">gboolean</a> is_running);
<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a>* <a href="glib-The-Main-Event-Loop.html#g-main-loop-ref">g_main_loop_ref</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
void <a href="glib-The-Main-Event-Loop.html#g-main-loop-unref">g_main_loop_unref</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
void <a href="glib-The-Main-Event-Loop.html#g-main-loop-run">g_main_loop_run</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
void <a href="glib-The-Main-Event-Loop.html#g-main-loop-quit">g_main_loop_quit</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
<a href="glib-Basic-Types.html#gboolean">gboolean</a> <a href="glib-The-Main-Event-Loop.html#g-main-loop-is-running">g_main_loop_is_running</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* <a href="glib-The-Main-Event-Loop.html#g-main-loop-get-context">g_main_loop_get_context</a> (<a href="glib-The-Main-Event-Loop.html#GMainLoop">GMainLoop</a> *loop);
#define <a href="glib-The-Main-Event-Loop.html#g-main-new">g_main_new</a> (is_running)
#define <a href="glib-The-Main-Event-Loop.html#g-main-destroy">g_main_destroy</a> (loop)
#define <a href="glib-The-Main-Event-Loop.html#g-main-run">g_main_run</a> (loop)
#define <a href="glib-The-Main-Event-Loop.html#g-main-quit">g_main_quit</a> (loop)
#define <a href="glib-The-Main-Event-Loop.html#g-main-is-running">g_main_is_running</a> (loop)
#define <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH:CAPS">G_PRIORITY_HIGH</a>
#define <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS">G_PRIORITY_DEFAULT</a>
#define <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS">G_PRIORITY_HIGH_IDLE</a>
#define <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT-IDLE:CAPS">G_PRIORITY_DEFAULT_IDLE</a>
#define <a href="glib-The-Main-Event-Loop.html#G-PRIORITY-LOW:CAPS">G_PRIORITY_LOW</a>
<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>;
<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* <a href="glib-The-Main-Event-Loop.html#g-main-context-new">g_main_context_new</a> (void);
<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* <a href="glib-The-Main-Event-Loop.html#g-main-context-ref">g_main_context_ref</a> (<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a> *context);
void <a href="glib-The-Main-Event-Loop.html#g-main-context-unref">g_main_context_unref</a> (<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a> *context);
<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a>* <a href="glib-The-Main-Event-Loop.html#g-main-context-default">g_main_context_default</a> (void);
<a href="glib-Basic-Types.html#gboolean">gboolean</a> <a href="glib-The-Main-Event-Loop.html#g-main-context-iteration">g_main_context_iteration</a> (<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a> *context,
<a href="glib-Basic-Types.html#gboolean">gboolean</a> may_block);
#define <a href="glib-The-Main-Event-Loop.html#g-main-iteration">g_main_iteration</a> (may_block)
<a href="glib-Basic-Types.html#gboolean">gboolean</a> <a href="glib-The-Main-Event-Loop.html#g-main-context-pending">g_main_context_pending</a> (<a href="glib-The-Main-Event-Loop.html#GMainContext">GMainContext</a> *context);
#define <a href="glib-The-Main-Event-Loop.html#g-main-pending">g_main_pending</a> ()
<a href="glib-The-Main-Event-Loop.html#GSource">GSource</a>* <a href="glib-The-Main-Event-Loop.html#g-main-context-find-source-by-id">g_main_context_find_source_by_id</a> (<a href="glib-The
评论0