PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

GladeXML::signal_connect | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

GladeXML::signal_connect

Connects all signals with the given handler to a callback function.

In glade, you can "connect" signals to "handlers". These handlers can be named like functions but not necessarily have to be: When using this signal_connect() function you can connect the handler "clicker" to a function called "test". When using signal_autoconnect() this is not possible as glade connects only handlers to functions of the same name as the handler.

Try to extend the example with the following (after glade instantiation and before gtk_main):
function tester()
{
    echo 'test' . "\r\n";
}
$glade->signal_connect( 'test', 'tester');
If you click the close button now, you will see an "test" output line in the shell prompt.

If you want to connect to a function of an object, you should use the following construct:
$glade->signal_connect( 'test', array( $obj, 'function'));
which would cause the 'function' function of the $obj object to be used as the callback for the test handler. Instead of an object you can use a normal string; this means the static function of this class is called:
$glade->signal_connect( 'test', array( 'gtk', 'main_quit'));
This would be the same as a call of gtk::main_quit().

You can pass any type and number of additional parameters to the callback function. Note that the first parameter will be the calling widget.

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「GladeXML::signal_connect」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | GladeXML::signal_connect」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: