Class: Wx::FocusEvent

Inherits:
Event show all
Defined in:
lib/wx/doc/gen/events.rb

Overview

A focus event is sent when a window’s focus changes.

The window losing focus receives a “kill focus” event while the window gaining it gets a “set focus” one. Notice that the set focus event happens both when the user gives focus to the window (whether using the mouse or keyboard) and when it is done from the program itself using Window#set_focus. The focus event handlers should almost invariably call Event#skip on their event argument to allow the default handling to take place. Failure to do this may result in incorrect behaviour of the native controls. Also note that EVT_KILL_FOCUS handler must not call Window#set_focus as this, again, is not supported by all native controls. If you need to do this, consider using the Delayed Action Mechanism described in IdleEvent documentation.

Events using this class

The following event-handler methods redirect the events to member method or handler blocks for FocusEvent events. Event handler methods:

Category: Events

See Also:

  • and Event Handling

Instance Method Summary collapse

Methods inherited from Event

#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(eventType = Wx::EVT_NULL, id = 0) ⇒ Wx::FocusEvent

Constructor.

Parameters:

  • eventType (Wx::GenericCollapsiblePane::EventType) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)


1567
# File 'lib/wx/doc/gen/events.rb', line 1567

def initialize(eventType=Wx::EVT_NULL, id=0) end

Instance Method Details

#get_windowWx::Window Also known as: window

Returns the window associated with this event, that is the window which had the focus before for the EVT_SET_FOCUS event and the window which is going to receive focus for the EVT_KILL_FOCUS one.

Warning: the window pointer may be NULL!

Returns:



1573
# File 'lib/wx/doc/gen/events.rb', line 1573

def get_window; end

#set_window(win) ⇒ void Also known as: window=

This method returns an undefined value.

Parameters:



1578
# File 'lib/wx/doc/gen/events.rb', line 1578

def set_window(win) end