Method: TkProgressframe#initialize
- Defined in:
- lib/a-tkcommons.rb
#initialize(parent = nil, _max = 100, *args) ⇒ TkProgressframe
Returns a new instance of TkProgressframe.
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 |
# File 'lib/a-tkcommons.rb', line 1595 def initialize(parent=nil, _max=100, *args) super(parent) _max=1 if _max<=0 @max = _max @progress = TkVariable.new @progress.value = -1 Tk::BWidget::ProgressBar.new(self, :width=>150, :height=>10, :background=>'red', :foreground=>'blue', :variable=>@progress, :borderwidth=>0, :relief=>'flat', :maximum=>_max).place('width' => '150','x' => 25,'y' => 30,'height' => 15) @buttons_frame = TkFrame.new(self, Arcadia.style('panel')).pack('fill'=>'x', 'side'=>'bottom') @b_cancel = TkButton.new(@buttons_frame, Arcadia.style('button')){|_b_go| default 'disabled' text 'Cancel' overrelief 'raised' justify 'center' pack('side'=>'top','ipadx'=>5, 'padx'=>5) } place('x'=>100,'y'=>100,'height'=> 120,'width'=> 200) end |