1# 2# ::vu::bargraph widget 3# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) 4# 5require 'tk' 6 7# create module/class 8module Tk 9 module Vu 10 class Bargraph < TkWindow 11 end 12 end 13end 14 15 16# call setup script -- <libdir>/tkextlib/vu.rb 17require 'tkextlib/vu.rb' 18 19class Tk::Vu::Bargraph < TkWindow 20 TkCommandNames = ['::vu::bargraph'.freeze].freeze 21 WidgetClassName = 'Bargraph'.freeze 22 WidgetClassNames[WidgetClassName] ||= self 23 24 ############################### 25 26 def __boolval_optkeys 27 ['showminmax', 'showvalue'] 28 end 29 private :__boolval_optkeys 30 31 def __strval_optkeys 32 super() + [ 33 'title', 34 'barbackground', 'barcolor', 'barcolour', 35 'tickcolor', 'tickcolour', 36 'textcolor', 'textcolour', 37 ] 38 end 39 private :__strval_optkeys 40 41 def __listval_optkeys 42 ['alabels', 'blabels'] 43 end 44 private :__listval_optkeys 45 46 def __font_optkeys 47 ['alabfont', 'blabfont'] 48 end 49 private :__font_optkeys 50 51 ############################### 52 53 def set(val = None) 54 tk_call_without_enc(@path, 'set', val) 55 self 56 end 57 58 def get() 59 num_or_str(tk_call_without_enc(@path, 'get')) 60 end 61end 62