Module: Glimmer::LibUI::CustomWindow

Includes:
CustomControl, SuperModule
Defined in:
lib/glimmer/libui/custom_window.rb

Instance Attribute Summary

Attributes included from CustomControl

#args, #body_root, #content, #keyword, #libui, #options, #parent, #parent_proxy, #slot_controls

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CustomControl

add_custom_control_namespaces_for, after_body, before_body, body, #can_handle_listener?, custom_control_namespaces, custom_controls_being_interpreted, def_option_attr_accessors, flyweight_custom_control_classes, for, #handle_listener, #has_instance_method?, keyword, namespaces_for_class, #observer_registrations, option, options, #post_add_content, #post_initialize_child, reset_custom_control_namespaces, shortcut_keyword

Class Method Details

.launch(*args, &content) ⇒ Object



33
34
35
36
37
# File 'lib/glimmer/libui/custom_window.rb', line 33

def launch(*args, &content)
  @@launched_custom_window = send(keyword, *args, &content)
  @@launched_custom_window.show
  @@launched_custom_window
end

.launched_applicationObject



43
44
45
# File 'lib/glimmer/libui/custom_window.rb', line 43

def launched_application
  launched_custom_window
end

.launched_custom_windowObject



39
40
41
# File 'lib/glimmer/libui/custom_window.rb', line 39

def launched_custom_window
  @@launched_custom_window if defined?(@@launched_custom_window)
end

Instance Method Details

#destroyObject

TODO consider using Forwardable instead



63
64
65
# File 'lib/glimmer/libui/custom_window.rb', line 63

def destroy
  body_root.destroy
end

#destroying?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/glimmer/libui/custom_window.rb', line 67

def destroying?
  body_root.destroying?
end

#initialize(parent, *swt_constants, options, &content) ⇒ Object

Raises:

  • (Glimmer::Error)


48
49
50
51
52
53
54
55
# File 'lib/glimmer/libui/custom_window.rb', line 48

def initialize(parent, *swt_constants, options, &content)
  original_logger = Glimmer::Config.logger
  require 'stringio'
  Glimmer::Config.logger = Logger.new(StringIO.new)
  super
  Glimmer::Config.logger = original_logger
  raise Glimmer::Error, 'Invalid custom window body root! Must be a window, another custom window, or a custom control with window as its body root!' unless body_root.is_a?(Glimmer::LibUI::ControlProxy::WindowProxy) || body_root.is_a?(Glimmer::LibUI::CustomWindow) || (body_root.is_a?(Glimmer::LibUI::CustomControl) && body_root.body_root.is_a?(Glimmer::LibUI::ControlProxy::WindowProxy))
end

#showObject

Classes may override



58
59
60
# File 'lib/glimmer/libui/custom_window.rb', line 58

def show
  body_root.show
end