PHP-GTK
Wednesday, September 17, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousaccel-closures-changed
button-release-eventnext

Last updated: Sun, 12 May 2013
view this page in English

button-press-event

This signal is emitted when a mouse button has been pressed down.

Useful event properties are:

Example 154. Using the key-press-event signal

<?php
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
 
//we want to receive mouse button press events
$wnd->set_events(Gdk::BUTTON_PRESS_MASK);
$wnd->connect('button-press-event', 'onButtonPress');
 
//here we handle the mouse button press events
function onButtonPress($widget, $event) {
    $widget->set_title($event->button . ' - ' . $event->x . ':' . $event->y);
}
$wnd->show();
 
Gtk::main();
?>

Callback function


User Contributed Notes
gtk.gtkwidget.signal.button-press-event.php
add a note about notes
There are no user contributed notes for this page.


previousaccel-closures-changed
button-release-eventnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:01 2013 CEST