Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
About The Best Formula In The World
Architecture details
Benchmarks
Books
By Reference Argument Passing
Compatibility between versions
Creating And Using Libraries
Database Datatype Mapping
Database Request Quoting
Date & time management
Dates and calendars
DBus and Gambas
Differences Between Shell And Exec
Differences From Visual Basic
Distributions & Operating Systems
Drag & Drop
DrawingArea Internal Behaviour
External functions datatype mapping
Frequently Asked Questions
Gambas Farm Server Protocol
Gambas Mailing List Netiquette
Gambas Markdown Syntax
Gambas Naming Conventions
Gambas Object Model
Gambas Scripting
Gambas Server Pages
Gambas Unit Testing
Gambas Wiki Markup Syntax
Getting Started With Gambas
Hall Of Fame
Housekeeping, cleaning up
Image Management In Gambas
Including Help Comments in Source Code
Interpreter limits
Introduction
Just In Time Compiler
Just In Time Compiler (old version)
License
Localisation and Internationalization
Mailing Lists & Forums
Naming Conventions
Network Programming
ODBC Component Documentation
PCRE Pattern Syntax
Porting from Gambas 2 to Gambas 3
Previous News
Project Directory Structure
Release Notes
Reporting a problem, a bug or a crash
Rich Text Syntax
Screenshots
Text highlighting definition file syntax
The Program has stopped unexpectedly by raising signal #11
Variable Naming Convention
WebPage Syntax
Web site home page
What Is Gambas?
Window & Form Management
Window Activation & Deactivation
Window Life Cycle
XML APIs
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

Window Life Cycle

Here is a little explanation of the birth and death of a window.

  1. There are two types of windows: real top-level windows and embedded windows (like the one embedded inside a tabstrip in the IDE).

  2. A window can be persistent or not. A non-persistent window is destroyed when you close it. A persistent window is just hidden.

  3. A window can be opened in modal (blocking) and non-modal (non-blocking) mode. The modal mode is implemented by using a local event loop. An embedded window opened in modal mode is temporarily made top-level.

  4. The first time a window is shown, an Open event is raised.

  5. A window can be closed by calling the Close method or by clicking on the close button of the window manager if the window is a top-level window.

  6. When a window is closed, a Close event is raised. If this event is not stopped, then the window is hidden. If the window is not persistent, it is destroyed too. If the window was opened in modal mode, then the local event loop used for implementing the modal mode is left.

  7. When a window has been closed, it can be opened again, and the Open event will be raised again.

  8. The integer argument of the Close method is returned by the ShowModal method.

  9. If you call Close during the Close event, the method does nothing.

  10. If you call Close during the Open event, the window is not opened.

  11. If you call Show or ShowModal while the window is being shown, the method does nothing.