Module: GuiRules

Defined in:
lib/gui_rules.rb,
lib/gui_rules/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#image_newObject



25
26
27
28
29
30
31
32
# File 'lib/gui_rules.rb', line 25

def image_new
  object = @objects[@data_stack.pop]
  image = Gtk::Image.new
  image.show
  id = unique_id
  @objects[id] = image
  @data_stack.push id
end

#image_setObject



34
35
36
37
38
# File 'lib/gui_rules.rb', line 34

def image_set
  object    = @objects[@data_stack.pop]
  filename  = @data_stack.pop
  object.set(filename)
end

#object_addObject



19
20
21
22
23
# File 'lib/gui_rules.rb', line 19

def object_add
  parent = @objects[@data_stack.pop]
  child  =  @objects[@data_stack.pop]
  parent.add child
end

#window_newObject



6
7
8
9
10
11
12
# File 'lib/gui_rules.rb', line 6

def window_new
  title = @data_stack.pop
  object = Gtk::Window.new(title)
  id = unique_id
  @objects[id] = object
  @data_stack.push id
end

#window_showObject



14
15
16
17
# File 'lib/gui_rules.rb', line 14

def window_show
  object = @objects[@data_stack.pop]
  object.show_all
end