Class: RUI::XmlGuiBuilder
- Defined in:
- lib/rui/toolkits/kde/kde.rb
Instance Method Summary collapse
- #action(name, opts = {}) ⇒ Object
- #action_list(name) ⇒ Object
- #group(name, &blk) ⇒ Object
-
#initialize ⇒ XmlGuiBuilder
constructor
A new instance of XmlGuiBuilder.
- #menu(name, opts = {}, &blk) ⇒ Object
- #menu_bar(&blk) ⇒ Object
- #separator ⇒ Object
- #tool_bar(name, opts = { }, &blk) ⇒ Object
Constructor Details
#initialize ⇒ XmlGuiBuilder
Returns a new instance of XmlGuiBuilder.
217 218 219 220 |
# File 'lib/rui/toolkits/kde/kde.rb', line 217 def initialize super @action_opts = { } end |
Instance Method Details
#action(name, opts = {}) ⇒ Object
233 234 235 |
# File 'lib/rui/toolkits/kde/kde.rb', line 233 def action(name, opts = {}) Action(opts.merge(@action_opts).merge(:name => name)) end |
#action_list(name) ⇒ Object
248 249 250 |
# File 'lib/rui/toolkits/kde/kde.rb', line 248 def action_list(name) ActionList(:name => name) end |
#group(name, &blk) ⇒ Object
252 253 254 255 256 257 258 259 260 |
# File 'lib/rui/toolkits/kde/kde.rb', line 252 def group(name, &blk) if block_given? @action_opts = { :group => name } blk[self] @action_opts = { } else DefineGroup(:name => name) end end |
#menu(name, opts = {}, &blk) ⇒ Object
226 227 228 229 230 231 |
# File 'lib/rui/toolkits/kde/kde.rb', line 226 def (name, opts = {}, &blk) Menu(:name => name) do |m| m.text(opts[:text]) if opts[:text] blk[m] if block_given? end end |
#menu_bar(&blk) ⇒ Object
222 223 224 |
# File 'lib/rui/toolkits/kde/kde.rb', line 222 def (&blk) MenuBar(&blk) end |
#separator ⇒ Object
237 238 239 |
# File 'lib/rui/toolkits/kde/kde.rb', line 237 def separator self.Separator end |
#tool_bar(name, opts = { }, &blk) ⇒ Object
241 242 243 244 245 246 |
# File 'lib/rui/toolkits/kde/kde.rb', line 241 def (name, opts = { }, &blk) ToolBar(:name => name) do |tb| tb.text(opts[:text]) if opts[:text] blk[tb] if block_given? end end |