如果用g_signal_connect( ) 链接一个X 事件,当回调函数返回值为TRUE的时候是不是控件就不再发出信
- jadeity
- 帖子: 689
- 注册时间: 2010-10-21 17:55
如果用g_signal_connect( ) 链接一个X 事件,当回调函数返回值为TRUE的时候是不是控件就不再发出信
如果用g_signal_connect( ) 链接一个X 事件,当回调函数返回值为TRUE的时候是不是控件就不再发出信号了?
- cwll
- 帖子: 190
- 注册时间: 2011-07-05 11:10
Re: 如果用g_signal_connect( ) 链接一个X 事件,当回调函数返回值为TRUE的时候是不是控件就不
g_signal_connect()
#define g_signal_connect(instance, detailed_signal, c_handler, data)
Connects a GCallback function to a signal for a particular object.
The handler will be called before the default handler of the signal.
instance :the instance to connect to.
detailed_signal :a string of the form "signal-name::detail".
c_handler :the GCallback to connect.
data :data to pass to c_handler calls.
Returns :the handler id
GTK的帮助文档如上,没有说 “当回调函数返回值为TRUE的时候是不是控件就不再发出信号了”
#define g_signal_connect(instance, detailed_signal, c_handler, data)
Connects a GCallback function to a signal for a particular object.
The handler will be called before the default handler of the signal.
instance :the instance to connect to.
detailed_signal :a string of the form "signal-name::detail".
c_handler :the GCallback to connect.
data :data to pass to c_handler calls.
Returns :the handler id
GTK的帮助文档如上,没有说 “当回调函数返回值为TRUE的时候是不是控件就不再发出信号了”
- supercatexpert
- 帖子: 403
- 注册时间: 2010-01-17 15:39
- 系统: Debian Wheezy AMD64
- 联系:
Re: 如果用g_signal_connect( ) 链接一个X 事件,当回调函数返回值为TRUE的时候是不是控件就不
不是,要看信号本身是否有做相应的处理,如果有这样的处理,那有可能根据返回值来判断是否继续发送信号。
这个特性需要在信号注册的时候指定。也就是g_signal_new()的第5和第6个参数,其中回调类型GSignalAccumulator的返回值可以决定信号是否继续发送
具体可参见此文: http://garfileo.is-programmer.com/2011/ ... 25621.html
这个特性需要在信号注册的时候指定。也就是g_signal_new()的第5和第6个参数,其中回调类型GSignalAccumulator的返回值可以决定信号是否继续发送
具体可参见此文: http://garfileo.is-programmer.com/2011/ ... 25621.html
OS: Debian Wheezy (Testing) for AMD64~~~
Mobile Phone: Nokia N900, OS: Maemo 5.0 (Base on Debian)~~~
本人的项目: RhythmCat(Linux下的音乐播放器.....支持歌词等功能...)
http://code.google.com/p/rhythmcat
RhythmCat 2进行中 (https://github.com/supercatexpert/RhythmCat2/)
Mobile Phone: Nokia N900, OS: Maemo 5.0 (Base on Debian)~~~
本人的项目: RhythmCat(Linux下的音乐播放器.....支持歌词等功能...)
http://code.google.com/p/rhythmcat
RhythmCat 2进行中 (https://github.com/supercatexpert/RhythmCat2/)