方法
GObjectObjectconnect
声明 [源代码]
GObject*
g_object_connect (
GObject* object,
const gchar* signal_spec,
...
)
描述 [源代码]
一次连接多个信号的便捷函数。
此函数期望的信号规范形式为 modifier::signal_name
,其中 modifier
可以是以下之一:
signal
:等同于g_signal_connect_data (..., NULL, G_CONNECT_DEFAULT)
object-signal
,object_signal
:等同于g_signal_connect_object (..., G_CONNECT_DEFAULT)
swapped-signal
,swapped_signal
:等同于g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
swapped_object_signal
,swapped-object-signal
:等同于g_signal_connect_object (..., G_CONNECT_SWAPPED)
signal_after
,signal-after
:等同于g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
object_signal_after
,object-signal-after
:等同于g_signal_connect_object (..., G_CONNECT_AFTER)
swapped_signal_after
,swapped-signal-after
:等同于g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
swapped_object_signal_after
,swapped-object-signal-after
:等同于g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)
menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
"type", GTK_WINDOW_POPUP,
"child", menu,
NULL),
"signal::event", gtk_menu_window_event, menu,
"signal::size_request", gtk_menu_window_size_request, menu,
"signal::destroy", gtk_widget_destroyed, &menu->toplevel,
NULL);
此方法直接不可用于语言绑定。
参数
signal_spec
-
类型:
const gchar*
第一个信号的定义。
该数据由方法调用者拥有。 该值是空终止的UTF-8字符串。 ...
-
类型:
GCallback
用于第一个信号,然后是第一个信号的参数,然后可选地跟随更多信号定义/回调/数据的组合,最后以NULL
结束。
返回值
类型: GObject
对象。
返回的数据由实例拥有。 |