Class: Scarpe::GlimmerLibUIDocumentRoot

Inherits:
GlimmerLibUIWidget show all
Includes:
GlimmerLibUIBackground
Defined in:
lib/scarpe/glibui/document_root.rb

Instance Attribute Summary collapse

Attributes inherited from GlimmerLibUIWidget

#parent, #shoes_linkable_id

Attributes inherited from Shoes::Linkable

#linkable_id

Instance Method Summary collapse

Methods included from GlimmerLibUIBackground

#style

Methods inherited from GlimmerLibUIWidget

#add_child, display_class_for, #remove_child, #set_parent

Methods inherited from Shoes::Linkable

#bind_shoes_event, #send_self_event, #send_shoes_event, #unsub_shoes_event

Constructor Details

#initialize(properties) ⇒ GlimmerLibUIDocumentRoot

Returns a new instance of GlimmerLibUIDocumentRoot.



9
10
11
12
# File 'lib/scarpe/glibui/document_root.rb', line 9

def initialize(properties)
  @callbacks = {}
  super
end

Instance Attribute Details

#debugObject (readonly)

Returns the value of attribute debug.



7
8
9
# File 'lib/scarpe/glibui/document_root.rb', line 7

def debug
  @debug
end

Instance Method Details

#bind(name, &block) ⇒ Object

Bind a Scarpe callback name; see Scarpe::Widget for how the naming is set up



29
30
31
# File 'lib/scarpe/glibui/document_root.rb', line 29

def bind(name, &block)
  @callbacks[name] = block
end

#display(properties = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/scarpe/glibui/document_root.rb', line 14

def display(properties = {})
  <<~GTEXT
    window("#{properties["title"] || "Scarpe with GlimmerLibUI"}", #{properties["width"] || 640}, #{properties["height"] || 480}) {
      horizontal_box {
        #{@children.map(&:display).join}
      }
    }.show
  GTEXT
end

#element(&blck) ⇒ Object



24
25
26
# File 'lib/scarpe/glibui/document_root.rb', line 24

def element(&blck)
  window(&blck).show
end