?? gtksignal.sgml
字號:
<para>Emits a signal by name. This causes the default handler and user-connectedhandlers to be run. This differs from gtk_signal_emit() by takingan array of GtkArgs instead of using C's varargs mechanism.</para>@object: the object to emit the signal to.@name: the name of the signal.@args: an array of GtkArgs, one for each parameter,followed by one which is a pointer to the return type.@Deprecated: Use g_signal_emitv() and g_signal_lookup() instead.<!-- ##### MACRO gtk_signal_emit_stop ##### --><para>This function aborts a signal's current emission.</para><para>It will prevent the default method from running,if the signal was #GTK_RUN_LAST and you connectednormally (i.e. without the "after" flag).</para><para>It will print a warning if used on a signal whichisn't being emitted.</para>@object: the object whose signal handlers you wish to stop.@signal_id: the signal identifier, as returned by g_signal_lookup().@Deprecated: Use g_signal_stop_emission() instead.<!-- ##### FUNCTION gtk_signal_emit_stop_by_name ##### --><para>This function aborts a signal's current emission.</para><para>It is just like gtk_signal_emit_stop()except it will lookup the signal id for you.</para>@object: the object whose signal handlers you wish to stop.@name: the name of the signal you wish to stop.@Deprecated: Use g_signal_stop_emission_by_name() instead.<!-- ##### MACRO gtk_signal_connect ##### --><para>Attaches a function pointer and user data to a signal fora particular object.</para><para>The #GtkSignalFunction takes a #GtkObject as its first parameter.It will be the same object as the one you're connectingthe hook to. The @func_data will be passed as the last parameterto the hook.</para><para>All else being equal, signal handlers are invoked in the order connected (see gtk_signal_emit() for the other details ofwhich order things are called in).</para><para>Here is how one passes an integer as user data,for when you just want to specify a constant intas parameter to your function:</para><informalexample><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));}</programlisting></informalexample>@object: the object associated with the signal, e.g. if a buttonis getting pressed, this is that button.@name: name of the signal.@func: function pointer to attach to the signal.@func_data: value to pass as to your function (through the marshaller).@Returns: the connection id.@Deprecated: Use g_signal_connect() instead.<!-- ##### MACRO gtk_signal_connect_after ##### --><para>Attaches a function pointer and user data to a signalso that this handler will be called after the other handlers.</para>@object: the object associated with the signal.@name: name of the signal.@func: function pointer to attach to the signal.@func_data: value to pass as to your function (through the marshaller).@Returns: the unique identifier for this attachment: the connection id.@Deprecated: Use g_signal_connect_after() instead.<!-- ##### MACRO gtk_signal_connect_object ##### --><para>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).</para><para>This is useful for passing a standard function in as a callback.For example, if you wanted a button's press to gtk_widget_show()some widget, you could write:</para><informalexample><programlisting>gtk_signal_connect_object (button, "clicked", gtk_widget_show, window);</programlisting></informalexample>@object: the object which emits the signal.@name: the name of the signal.@func: the function to callback.@slot_object: the object to pass as the first parameter to func.(Though it pretends to take an object, you canreally pass any gpointer as the #slot_object .)@Returns: the connection id.@Deprecated: Use g_signal_connect_swapped() instead.<!-- ##### MACRO gtk_signal_connect_object_after ##### --><para>Attaches a signal hook to a signal, passing in an alternateobject as the first parameter, and guaranteeing that the default handler and all normalhandlers are called first.</para>@object: the object associated with the signal.@name: name of the signal.@func: function pointer to attach to the signal.@slot_object: the object to pass as the first parameter to #func.@Returns: the connection id.@Deprecated: Use g_signal_connect_data() instead, passing <literal>G_CONNECT_AFTER|G_CONNECT_SWAPPED</literal> as @connect_flags.<!-- ##### FUNCTION gtk_signal_connect_full ##### --><para>Attaches a function pointer and user data to a signal withmore control.</para>@object: the object which emits the signal. For example, a buttonin the button press signal.@name: the name of the signal.@func: function pointer to attach to the signal.@unsupported: @data: the user data associated with the function.@destroy_func: function to call when this particular hook is disconnected.@object_signal: whether this is an object signal-- basically an "objectsignal" is one that wants its user_data and object fields switched,which is useful for calling functions which operate on anotherobject primarily.@after: whether to invoke the user-defined handler after the signal, or to let the signal's default behavior preside (i.e. depending on #GTK_RUN_FIRSTand #GTK_RUN_LAST).@Returns: the connection id.@Deprecated: Use g_signal_connect_data() instead.<!-- ##### FUNCTION gtk_signal_connect_while_alive ##### --><para>Attaches a function pointer and another #GtkObject to a signal.</para><para>This function takes an object whose "destroy" signalshould be trapped.That way, you don't have to clean up thesignal handler when you destroy the object.It is a little less efficient though.</para><para>(Instead you may call gtk_signal_disconnect_by_data(), if you wantto explicitly delete all attachments to this object. Thisis perhaps not recommended since it could be confusedwith an integer masquerading as a pointer (through GINT_TO_POINTER()).)</para>@object: the object that emits the signal.@name: name of the signal.@func: function pointer to attach to the signal.@func_data: pointer to pass to func.@alive_object: object whose death should cause the handler connectionto be destroyed.@Deprecated: Use g_signal_connect_object() instead.<!-- ##### FUNCTION gtk_signal_connect_object_while_alive ##### --><para>These signal connectors are for signals which refer to objects,so they must not be called after the object is deleted.</para><para>Unlike gtk_signal_connect_while_alive(),this swaps the object and user data, making it suitable foruse with functions which primarily operate on the user data.</para><para>This function acts just like gtk_signal_connect_object() exceptit traps the "destroy" signal to prevent you from having toclean up the handler.</para>@object: the object associated with the signal.@name: name of the signal.@func: function pointer to attach to the signal.@alive_object: the user data, which must be an object, whose destructionshould signal the removal of this signal.@Deprecated: Use g_signal_connect_object() instead, passing <literal>G_CONNECT_SWAPPED</literal> as @connect_flags.<!-- ##### MACRO gtk_signal_disconnect ##### --><para>Destroys a user-defined handler connection.</para>@object: the object which the handler pertains to.@handler_id: the connection id.@Deprecated: Use g_signal_handler_disconnect() instead.<!-- ##### MACRO gtk_signal_disconnect_by_func ##### --><para>Destroys all connections for a particular object, withthe given function-pointer and user-data.</para>@object: the object which emits the signal.@func: the function pointer to search for.@data: the user data to search for.@Deprecated: Use g_signal_handlers_disconnect_by_func() instead.<!-- ##### MACRO gtk_signal_disconnect_by_data ##### --><para>Destroys all connections for a particular object, withthe given user-data.</para>@object: the object which emits the signal.@data: the user data to search for.@Deprecated: Use g_signal_handlers_disconnect_matched() instead.<!-- ##### MACRO gtk_signal_handler_block ##### --><para>Prevents a user-defined handler from being invoked. All othersignal processing will go on as normal, but this particularhandler will ignore it.</para>@object: the object which emits the signal to block.@handler_id: the connection id.@Deprecated: Use g_signal_handler_block() instead.<!-- ##### MACRO gtk_signal_handler_block_by_func ##### --><para>Prevents a user-defined handler from being invoked, by reference tothe user-defined handler's function pointer and user data. (It may result inmultiple hooks being blocked, if you've called connect multiple times.)</para>@object: the object which emits the signal to block.@func: the function pointer of the handler to block.@data: the user data of the handler to block.@Deprecated: Use g_signal_handlers_block_by_func() instead.<!-- ##### MACRO gtk_signal_handler_block_by_data ##### --><para>Prevents all user-defined handlers with a certain user data from being invoked.</para>@object: the object which emits the signal we want to block.@data: the user data of the handlers to block.@Deprecated: Use g_signal_handlers_block_matched() instead.<!-- ##### MACRO gtk_signal_handler_unblock ##### --><para>Undoes a block, by connection id. Note that undoing a block doesn'tnecessarily make the hook callable, because if you block ahook twice, you must unblock it twice.</para>@object: the object which emits the signal we want to unblock.@handler_id: the emission handler identifier, as returned bygtk_signal_connect(), etc.@Deprecated: Use g_signal_handler_unblock() instead.<!-- ##### MACRO gtk_signal_handler_unblock_by_func ##### --><para>Undoes a block, by function pointer and data.Note that undoing a block doesn'tnecessarily make the hook callable, because if you block ahook twice, you must unblock it twice.</para>@object: the object which emits the signal we want to unblock.@func: the function pointer to search for.@data: the user data to search for.@Deprecated: Use g_signal_handlers_unblock_by_func() instead.<!-- ##### MACRO gtk_signal_handler_unblock_by_data ##### --><para>Undoes block(s), to all signals for a particular objectwith a particular user-data pointer</para>@object: the object which emits the signal we want to unblock.@data: the user data to search for.@Deprecated: Use g_signal_handlers_unblock_matched() instead.<!-- ##### MACRO gtk_signal_handler_pending ##### --><para>Returns a connection id corresponding to a given signal id and object.</para><para>One example of when you might use this is when the argumentsto the signal are difficult to compute. A class implementormay opt to not emit the signal if no one is attached anyway,thus saving the cost of building the arguments.</para>@object: the object to search for the desired user-defined handler.@signal_id: the number of the signal to search for.@may_be_blocked: whether it is acceptable to return a blockedhandler.@Returns: the connection id, if a connection was found. 0 otherwise.@Deprecated: Use g_signal_has_handler_pending() instead.<!-- ##### MACRO gtk_signal_handler_pending_by_func ##### --><para>Returns a connection id corresponding to a given signal id, object, functionpointer and user data.</para>@object: the object to search for the desired handler.@signal_id: the number of the signal to search for.@may_be_blocked: whether it is acceptable to return a blockedhandler.@func: the function pointer to search for.@data: the user data to search for.@Returns: the connection id, if a handler was found. 0 otherwise.<!-- ##### MACRO gtk_signal_default_marshaller ##### --><para>A marshaller that returns void and takes no extra parameters.</para>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -