|
Chapter 3 Signal Handling |
| Written by kksou | ||
| Sunday, 13 April 2008 | ||
What are SignalsSignals are the links between your php-gtk application and the user. Signals allow you to know when the user do something — clicked a button, pressed a key, inserted a character, deleted a row, selected an image, etc. Through signals, you are able to act accordingly based on user's actions. Connecting SignalsSignals are like the newsletters or news feeds. There are millions of free newsletters and news feeds currently out there on Internet. You only subscribe to the ones you are interested, so that you will not be flooded with too much information. Same for signals. Take a look at the PHP-GTK manual. There are hundreds of signals listed there. You probably do not need to be informed about all these signals in your application. You register with php-gtk which are the ones you're interested in with the connect() method. Signal NameTake a look again at the index of signals in the php-gtk manual. In php-gtk each signal is identified by a unique name. For example,
When you register a signal with connect(), you need to know the name of this signal and specify it as the first argument. Callback FunctionWhen you register a signal with connect(), you also specify the name of your callback function as the second argument. For example, after you have registered the 'click' signal with Since the callback function is used to handle a signal, you will sometimes see a callback function being referred to as a signal handler. User reviews There are no user reviews yet. Note: You have to be a registered member to leave a comment. Free registration here. |
||
| < Prev | Next > |
|---|




