Class: Wx::SizeEvent
Overview
A size event holds information about size change events of Window.
The EVT_SIZE handler function will be called when the window has been resized. You may wish to use this for frames to resize their child windows as appropriate. Note that the size passed is of the whole window: call Window#get_client_size for the area which may be used by the application. When a window is resized, usually only a small part of the window is damaged and you may only need to repaint that area. However, if your drawing depends on the size of the window, you may need to clear the DC explicitly and repaint the whole window. In which case, you may need to call Window#refresh to invalidate the entire window. Important : Sizers ( see Sizers Overview ) rely on size events to function correctly. Therefore, in a sizer-based layout, do not forget to call Skip on all size events you catch (and don’t catch size events at all when you don’t need to).
Events using this class
The following event-handler methods redirect the events to member method or handler blocks for SizeEvent events. Event handler methods:
-
EvtHandler#evt_size(meth = nil, &block): Process a EVT_SIZE event.
Category: Events
Instance Method Summary collapse
- #get_rect ⇒ Wx::Rect (also: #rect)
-
#get_size ⇒ Wx::Size
(also: #size)
Returns the entire size of the window generating the size change event.
-
#initialize(sz, id = 0) ⇒ Wx::SizeEvent
constructor
Constructor.
- #set_rect(rect) ⇒ void (also: #rect=)
- #set_size(size) ⇒ void (also: #size=)
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(sz, id = 0) ⇒ Wx::SizeEvent
Constructor.
1375 |
# File 'lib/wx/doc/gen/events.rb', line 1375 def initialize(sz, id=0) end |
Instance Method Details
#get_rect ⇒ Wx::Rect Also known as: rect
1390 |
# File 'lib/wx/doc/gen/events.rb', line 1390 def get_rect; end |
#get_size ⇒ Wx::Size Also known as: size
Returns the entire size of the window generating the size change event.
This is the new total size of the window, i.e. the same size as would be returned by Window#get_size if it were called now. Use Window#get_client_size if you catch this event in a top level window such as Frame to find the size available for the window contents.
1381 |
# File 'lib/wx/doc/gen/events.rb', line 1381 def get_size; end |
#set_rect(rect) ⇒ void Also known as: rect=
This method returns an undefined value.
1395 |
# File 'lib/wx/doc/gen/events.rb', line 1395 def set_rect(rect) end |
#set_size(size) ⇒ void Also known as: size=
This method returns an undefined value.
1386 |
# File 'lib/wx/doc/gen/events.rb', line 1386 def set_size(size) end |