1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
12 def square_tag(name, element, opts = {})
13 define_method(name) do
14 instance_variable_get("@#{name}")
17 define_method("#{name}=") do |val|
18 instance_variable_set("@#{name}", val)
20 options = { :pos => to_real(val),
21 :z => TAGS_ZVALUE }.merge(opts)
22 square_tag_container.add_item(
24 theme.board.send(element, unit),
27 square_tag_container.remove_item(name)
33 def self.included(klass)
34 klass.extend ClassMethods
39 def set_tag(name, value)
40 send("#{name}=", value)
43 def square_tag_container