Changes between Version 1 and Version 2 of GtkSimpleWindow
- Timestamp:
- 10/31/11 18:11:51 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GtkSimpleWindow
v1 v2 7 7 The following program is in two parts: 8 8 9 a. The class `MyWindow` will be the main window for the application. `MyWindow` inherits from the Gtk `Window` class, and the `init` method initialises its parent with the given title.9 1. The class `MyWindow` will be the main window for the application. `MyWindow` inherits from the Gtk `Window` class, and the `init` method initialises its parent with the given title. 10 10 * `.setDefaultSize` is called to create a sensible size for the window 11 11 * `listen` is used to attach a method to the `deleteEvent`, called when the user clicks the close window button. 12 12 13 b. The `main` method in `MainProgram` goes through four stages to create and display a Gtk application:13 2. The `main` method in `MainProgram` goes through four stages to create and display a Gtk application: 14 14 1. start the graphical application 15 2. create an instance of the main window16 3. request all widgets in the main window to show themselves17 4. finally, run the graphical application15 1. create an instance of the main window 16 1. request all widgets in the main window to show themselves 17 1. finally, run the graphical application 18 18 19 19 {{{