Re: Key bindings?
| From: | (Aaron Bishell) | Date: | Sun, 29 Dec 2002 23:12:48 +0000 |
| Subject: | Re: Key bindings? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2820@lists.php.net to get a copy of this message | ||
/* The function that is called when the 1 button is pressed */
function to_do_when_one_is_clicked ()
{
//...
}
/* Define your button */
$the_one_widget=new GtkButton("1");
/* Connect your button */
$the_one_widget->connect("clicked", "to_do_when_one_is_clicked");
There are also a number of other signals you may find useful. They can be
found here: http://gtk.php.net/manual/en/gtk.gtkbutton.php
Benjamin Smith wrote:
> Learning GTK and GUI programming with PHP-GTK, to leverage my experience
with PHP. (Love it so far!)
> How do I bind keys to the click/press of a widget?
> For example, I'm writing a calculator. How do a "click" the 1 widget when I
press a "1" on the keyboard?
> Thanks,
> -Ben
> - The best way to predict the future is to invent it. -