Class: RUI::XmlGuiBuilder

Inherits:
Builder::XmlMarkup
  • Object
show all
Defined in:
lib/rui/toolkits/kde/kde.rb

Instance Method Summary collapse

Constructor Details

#initializeXmlGuiBuilder

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


226
227
228
229
230
231
# File 'lib/rui/toolkits/kde/kde.rb', line 226

def menu(name, opts = {}, &blk)
  Menu(:name => name) do |m|
    m.text(opts[:text]) if opts[:text]
    blk[m] if block_given?
  end
end


222
223
224
# File 'lib/rui/toolkits/kde/kde.rb', line 222

def menu_bar(&blk)
  MenuBar(&blk)
end

#separatorObject



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 tool_bar(name, opts = { }, &blk)
  ToolBar(:name => name) do |tb|
    tb.text(opts[:text]) if opts[:text]
    blk[tb] if block_given?
  end
end