2005-03-05 07:35:41 +00:00
|
|
|
#
|
|
|
|
# tprogressbar widget
|
|
|
|
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
|
|
|
#
|
|
|
|
require 'tk'
|
|
|
|
require 'tkextlib/tile.rb'
|
|
|
|
|
|
|
|
module Tk
|
|
|
|
module Tile
|
2005-04-09 09:27:54 +00:00
|
|
|
class TProgressbar < TkWindow
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
2005-08-04 04:48:13 +00:00
|
|
|
Progressbar = TProgressbar
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Tk::Tile::TProgressbar
|
|
|
|
include Tk::Tile::TileWidget
|
|
|
|
|
|
|
|
if Tk::Tile::USE_TTK_NAMESPACE
|
|
|
|
TkCommandNames = ['::ttk::progressbar'.freeze].freeze
|
|
|
|
else
|
|
|
|
TkCommandNames = ['::tprogressbar'.freeze].freeze
|
|
|
|
end
|
|
|
|
WidgetClassName = 'TProgressbar'.freeze
|
|
|
|
WidgetClassNames[WidgetClassName] = self
|
|
|
|
|
2005-04-09 09:27:54 +00:00
|
|
|
def self.style(*args)
|
|
|
|
[self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
|
|
|
|
end
|
|
|
|
|
2005-03-05 07:35:41 +00:00
|
|
|
def step
|
|
|
|
tk_send_without_enc('step').to_f
|
|
|
|
end
|
|
|
|
def step=(amount)
|
|
|
|
tk_send_without_enc('step', amount)
|
|
|
|
end
|
|
|
|
|
2005-08-02 11:49:46 +00:00
|
|
|
def start(interval=None)
|
|
|
|
tk_call_without_enc('::tile::progressbar::start', @path, interval)
|
2005-03-05 07:35:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop
|
|
|
|
tk_call_without_enc('::tile::progressbar::stop', @path)
|
|
|
|
end
|
|
|
|
end
|