|
1.2 Display a button |
| Written by kksou | ||||
| Wednesday, 12 March 2008 | ||||
ObjectiveLet's use another widget in this example - a button. OverviewIn the previous example, we use GtkLabel to display "Hello World". In this example, we use GtkButton to display a button. The GtkLabel and GtkButton are called widgets in php-gtk. There are many other widgets in such as GtkRadioButton, GtkMenu, GtkTable, including GtkWindow.
Sample Output
Sample Code
ExplanationFor almost all php-gtk2 scripts, you will find the following four key lines (highlighted in blue):
NoteThink of widgets as different types of Lego building blocks. Some are plain rectangular blocks. Some are round blocks. Some have buttons. By creatively combining these different building blocks, we can build almost anything we have in mind. Same for php-gtk2. Writing php-gtk2 scripts is all about knowing what are the widgets available, and their corresponding properties, methods and signals. 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 > |
|---|





