Class: Wx::PersistentWindowBase
- Inherits:
-
PersistentObject
- Object
- PersistentObject
- Wx::PersistentWindowBase
- Defined in:
- lib/wx/doc/gen/persistent_window.rb
Overview
Base class for persistent windows.
Compared to PersistentObject this class does three things:
-
Most importantly, PersistentWindow catches WindowDestroyEvent generated when the window is destroyed and saves its properties automatically when it happens.
-
It implements #get_name using Window#get_name so that the derived classes don’t need to do it.
-
It adds a convenient #get accessor returning the window object of the correct type.
Instance Method Summary collapse
- #get ⇒ Wx::Window
-
#get_name ⇒ String
(also: #name)
Implements the base class pure virtual method using Window#get_name.
-
#initialize(win) ⇒ Wx::PersistentWindowBase
constructor
Constructor for a persistent window object.
Methods inherited from PersistentObject
#get_kind, #restore, #restore_value, #save, #save_value
Constructor Details
#initialize(win) ⇒ Wx::PersistentWindowBase
Constructor for a persistent window object.
The constructor uses EvtHandler#bind to catch WindowDestroyEvent generated when the window is destroyed and call Wx::PersistenceManager#save_and_unregister when this happens. This ensures that the window properties are saved and that this object itself is deleted when the window is.
25 |
# File 'lib/wx/doc/gen/persistent_window.rb', line 25 def initialize(win) end |
Instance Method Details
#get_name ⇒ String Also known as: name
Implements the base class pure virtual method using Window#get_name.
Notice that window names are usually not unique while this function must return a unique (at least among the objects of this type) string. Because of this you need to specify a non-default window name in its constructor when creating it or explicitly call Window#set_name before saving or restoring persistent properties.
34 |
# File 'lib/wx/doc/gen/persistent_window.rb', line 34 def get_name; end |