⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk-signals.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *name,                                                         <a class="link" href="gtk-Types.html#GtkArg">GtkArg</a> *args);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_emitv_by_name</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-emitv"><code class="function">g_signal_emitv()</code></a> and <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-lookup"><code class="function">g_signal_lookup()</code></a> instead.</p></div><p>Emits a signal by name.  This causes the default handler and user-connectedhandlers to be run.  This differs from <a class="link" href="gtk-Signals.html#gtk-signal-emit"><code class="function">gtk_signal_emit()</code></a> by takingan array of GtkArgs instead of using C's varargs mechanism.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object to emit the signal to.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td>the name of the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>args</code></em>&#160;:</span></p></td><td>an array of GtkArgs, one for each parameter,followed by one which is a pointer to the return type.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3333405"></a><h3><a name="gtk-signal-emit-stop"></a>gtk_signal_emit_stop()</h3><a class="indexterm" name="id3333421"></a><pre class="programlisting">#define             gtk_signal_emit_stop(object,signal_id)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_emit_stop</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-stop-emission"><code class="function">g_signal_stop_emission()</code></a> instead.</p></div><p>This function aborts a signal's current emission.</p><p>It will prevent the default method from running,if the signal was <span class="type">GTK_RUN_LAST</span> and you connectednormally (i.e. without the "after" flag).</p><p>It will print a warning if used on a signal whichisn't being emitted.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object whose signal handlers you wish to stop.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>signal_id</code></em>&#160;:</span></p></td><td>the signal identifier, as returned by <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-lookup"><code class="function">g_signal_lookup()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3333524"></a><h3><a name="gtk-signal-emit-stop-by-name"></a>gtk_signal_emit_stop_by_name ()</h3><a class="indexterm" name="id3333541"></a><pre class="programlisting">void                gtk_signal_emit_stop_by_name        (<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a> *object,                                                         const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *name);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_emit_stop_by_name</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-stop-emission-by-name"><code class="function">g_signal_stop_emission_by_name()</code></a> instead.</p></div><p>This function aborts a signal's current emission.</p><p>It is just like <a class="link" href="gtk-Signals.html#gtk-signal-emit-stop"><code class="function">gtk_signal_emit_stop()</code></a>except it will lookup the signal id for you.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object whose signal handlers you wish to stop.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td>the name of the signal you wish to stop.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3333653"></a><h3><a name="gtk-signal-connect"></a>gtk_signal_connect()</h3><a class="indexterm" name="id3333668"></a><pre class="programlisting">#define             gtk_signal_connect(object,name,func,func_data)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_connect</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a> instead.</p></div><p>Attaches a function pointer and user data to a signal fora particular object.</p><p>The <span class="type">GtkSignalFunction</span> takes a <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> as its first parameter.It will be the same object as the one you're connectingthe hook to.  The <em class="parameter"><code>func_data</code></em> will be passed as the last parameterto the hook.</p><p>All else being equal, signal handlers are invoked in the order connected (see <a class="link" href="gtk-Signals.html#gtk-signal-emit"><code class="function">gtk_signal_emit()</code></a> for the other details ofwhich order things are called in).</p><p>Here is how one passes an integer as user data,for when you just want to specify a constant intas parameter to your function:</p><div class="informalexample"><pre class="programlisting">static void button_clicked_int (GtkButton* button, gpointer func_data){	g_print ("button pressed: %d\n", GPOINTER_TO_INT (func_data));}/* By calling this function, you will make the g_print above * execute, printing the number passed as `to_print'. */static void attach_print_signal (GtkButton* button, gint to_print){	gtk_signal_connect (GTK_OBJECT (button), "clicked",		GTK_SIGNAL_FUNC (button_clicked_int),		GINT_TO_POINTER (to_print));}</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object associated with the signal, e.g. if a buttonis getting pressed, this is that button.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td>name of the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td>function pointer to attach to the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func_data</code></em>&#160;:</span></p></td><td>value to pass as to your function (through the marshaller).</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>the connection id.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3333849"></a><h3><a name="gtk-signal-connect-after"></a>gtk_signal_connect_after()</h3><a class="indexterm" name="id3333866"></a><pre class="programlisting">#define             gtk_signal_connect_after(object,name,func,func_data)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_connect_after</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-after"><code class="function">g_signal_connect_after()</code></a> instead.</p></div><p>Attaches a function pointer and user data to a signalso that this handler will be called after the other handlers.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object associated with the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td>name of the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td><td>function pointer to attach to the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>func_data</code></em>&#160;:</span></p></td><td>value to pass as to your function (through the marshaller).</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>the unique identifier for this attachment:  the connection id.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3333982"></a><h3><a name="gtk-signal-connect-object"></a>gtk_signal_connect_object()</h3><a class="indexterm" name="id3333998"></a><pre class="programlisting">#define             gtk_signal_connect_object(object,name,func,slot_object)</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_signal_connect_object</code> is deprecated and should not be used in newly-written code. Use <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-swapped"><code class="function">g_signal_connect_swapped()</code></a> instead.</p></div><p>This function is for registering a callback that willcall another object's callback.  That is,instead of passing the object which is responsiblefor the event as the first parameter of the callback,it is switched with the user data (so the object which emitsthe signal will be the last parameter, which is where theuser data usually is).</p><p>This is useful for passing a standard function in as a callback.For example, if you wanted a button's press to <a class="link" href="GtkWidget.html#gtk-widget-show"><code class="function">gtk_widget_show()</code></a>some widget, you could write:</p><div class="informalexample"><pre class="programlisting">gtk_signal_connect_object (button, "clicked", gtk_widget_show, window);</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></p></td><td>the object which emits the signal.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td><td>the name of the signal.

⌨️ 快捷键说明

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