October 2002
Intermediate to advanced
368 pages
7h 12m
English
So now you know how to make a label, a button (with a label in it), and a text entry field. With these three tools, you can begin to build an application!
First, we need to know how to get the text the user enters in the text entry widget. The GtkTextEntry widget has a method that meets our needs:
$input = $text1->get_text();
You can assign the user-entered data using the get_text() method on the $text1 object to a variable (for example $input), then do whatever you want with that text. The following script puts it all together and provides a short example of a function to handle the user-entered text. See Figure 12-6 for example output.
1. <?php 2. if (!class_exists('gtk')) { 3. if (strtoupper(substr(PHP_OS, ... |
Read now
Unlock full access