clicked
The "clicked" signal is
emitted at the midpoint between pressing and releasing the
mouse-button. This is the most commonly used
GtkButton signal, and holds an advantage over
the other signals listed here in that it also responds to
enter or spacebar keypresses as
though they were mouse-clicks. Signals that have this property are
wrappers for an internal GtkWidget signal
named 'activate_signal'; all interactive widgets contain one such
method/signal pair, with appropriate keyboard bindings.
Note that the "clicked"
signal will not fire when the mouse-button is released after the cursor
has left the widget's region. The activate type of
signals are by nature region-specific.
Use one of the connect()
methods in order to emit the signal and connect it to your function.
The connected function is known as the callback or
signal-handler function:
Example 5. Making a simple connection <?php
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
function my_function() {
echo "The button was clicked\n";
}
$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_MOUSE);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$button = &new GtkButton("Click Me");
$button->connect('clicked', 'my_function');
$window->add($button);
$window->show_all();
gtk::main();
?>
|
For further information about connecting signals, refer to the
Signals and Callbacks
chapter in the PHP-GTK Userguide.
Callback function
|
Network sites:
|
Active-Domain.com: cheap
domain register and domain name
registration
Cheap domains registration and domain transfer
with free domain hosting
|
| |
|
|
|
Quotes: |
|
Everyone complains of his memory, but no one complains of his judgment.
|
|
|