Class: Wx::PersistentWindowBase

Inherits:
PersistentObject show all
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.

Requires:

  • USE_CONFIG

Instance Method Summary collapse

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.

Parameters:



25
# File 'lib/wx/doc/gen/persistent_window.rb', line 25

def initialize(win) end

Instance Method Details

#getWx::Window

Returns:



28
# File 'lib/wx/doc/gen/persistent_window.rb', line 28

def get; end

#get_nameString 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.

Returns:

  • (String)


34
# File 'lib/wx/doc/gen/persistent_window.rb', line 34

def get_name; end