Method: TkWidgetFactory#button

Defined in:
lib/a-tkcommons.rb

#button(_parent, _args = {}, &b) ⇒ Object



2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
# File 'lib/a-tkcommons.rb', line 2579

def button(_parent,_args={}, &b)
  begin
    if @use_tile
      obj = Tk::Tile::Button.new(_parent,{:style=>"Arcadia.TButton"}.update(_args), &b)
    else
      obj = TkButton.new(_parent,Arcadia.style('button').update(_args), &b)
    end
    class << obj
      include WidgetEnhancer
    end
    return obj
  rescue RuntimeError => e
    Arcadia.runtime_error(e) 
    return nil
  end
end