Class: Wx::RT::ThreadEvent

Inherits:
Event show all
Defined in:
lib/wx/doc/gen/rt/thread_event.rb,
lib/wx/doc/rt/thread_event.rb

Overview

This class adds some simple functionality to Event to facilitate inter-thread communication.

This event is not natively emitted by any control/class: it is just a helper class for the user. Its most important feature is the #get_event_category implementation which allows thread events NOT to be processed by GUIEventLoop#yield_for calls (unless the EventCategory::EVT_CATEGORY_THREAD is specified - which is never in wx code).

In wxRuby user defined classes can be derived from this class but it is important to note that when used with SharedEvtHandler#queue_message (the only imaginable use for thread events) no Ruby state will ever persist and adding instance variables is therefor not useful. The real benefit of being able to derive from this class is that it provides for the registration and use of user defined event types for the derived classes allowing to differentiate in event handling.

See Also:

Requires:

  • USE_THREADS

Instance Method Summary collapse

Methods inherited from Event

#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

#dup, #is_same_as, #un_share

Constructor Details

#initialize(eventType = Wx::EVT_THREAD, id = Wx::StandardID::ID_ANY) ⇒ Wx::RT::ThreadEvent

Constructor.

Parameters:

  • eventType (Integer) (defaults to: Wx::EVT_THREAD)
  • id (Integer) (defaults to: Wx::StandardID::ID_ANY)


22
# File 'lib/wx/doc/rt/thread_event.rb', line 22

def initialize(eventType=Wx::EVT_THREAD, id=Wx::StandardID::ID_ANY) end

Instance Method Details

#cloneWx::Event

Clones this event making sure that all internal members which use COW (only m_commandString for now; see Reference Counting) are unshared (see Object#un_share).

Returns:



31
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 31

def clone; end

#get_extra_longInteger Also known as: extra_long

Returns extra information integer value.

Returns:

  • (Integer)


35
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 35

def get_extra_long; end

#get_intInteger Also known as: int

Returns stored integer value.

Returns:

  • (Integer)


40
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 40

def get_int; end

#get_stringString Also known as: string

Returns stored string value.

Returns:

  • (String)


45
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 45

def get_string; end

#set_extra_long(extraLong) ⇒ void Also known as: extra_long=

This method returns an undefined value.

Sets the extra information value.

Parameters:

  • extraLong (Integer)


51
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 51

def set_extra_long(extraLong) end

#set_int(intCommand) ⇒ void Also known as: int=

This method returns an undefined value.

Sets the integer value.

Parameters:

  • intCommand (Integer)


57
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 57

def set_int(intCommand) end

#set_string(string) ⇒ void Also known as: string=

This method returns an undefined value.

Sets the string value.

Parameters:

  • string (String)


63
# File 'lib/wx/doc/gen/rt/thread_event.rb', line 63

def set_string(string) end