Namespace
- MODULE Tk::Tile::Font
- MODULE Tk::Tile::KeyNav
- MODULE Tk::Tile::ParseStyleLayout
- MODULE Tk::Tile::Style
- MODULE Tk::Tile::TileWidget
- MODULE Tk::Tile::TreeviewConfig
- CLASS Tk::Tile::Dialog
- CLASS Tk::Tile::SizeGrip
- CLASS Tk::Tile::SizeGrip
- CLASS Tk::Tile::TButton
- CLASS Tk::Tile::TButton
- CLASS Tk::Tile::TCheckButton
- CLASS Tk::Tile::TCheckButton
- CLASS Tk::Tile::TCheckButton
- CLASS Tk::Tile::TCheckButton
- CLASS Tk::Tile::TCombobox
- CLASS Tk::Tile::TCombobox
- CLASS Tk::Tile::TEntry
- CLASS Tk::Tile::TEntry
- CLASS Tk::Tile::TFrame
- CLASS Tk::Tile::TFrame
- CLASS Tk::Tile::TLabel
- CLASS Tk::Tile::TLabel
- CLASS Tk::Tile::TLabelframe
- CLASS Tk::Tile::TLabelframe
- CLASS Tk::Tile::TLabelframe
- CLASS Tk::Tile::TLabelframe
- CLASS Tk::Tile::TMenubutton
- CLASS Tk::Tile::TMenubutton
- CLASS Tk::Tile::TMenubutton
- CLASS Tk::Tile::TMenubutton
- CLASS Tk::Tile::TNotebook
- CLASS Tk::Tile::TNotebook
- CLASS Tk::Tile::TPaned
- CLASS Tk::Tile::TProgress
- CLASS Tk::Tile::TProgress
- CLASS Tk::Tile::TProgressbar
- CLASS Tk::Tile::TProgressbar
- CLASS Tk::Tile::TRadioButton
- CLASS Tk::Tile::TRadioButton
- CLASS Tk::Tile::TRadioButton
- CLASS Tk::Tile::TRadioButton
- CLASS Tk::Tile::TScale
- CLASS Tk::Tile::TScale
- CLASS Tk::Tile::TScrollbar
- CLASS Tk::Tile::TScrollbar
- CLASS Tk::Tile::TSeparator
- CLASS Tk::Tile::TSeparator
- CLASS Tk::Tile::TSpinbox
- CLASS Tk::Tile::TSpinbox
- CLASS Tk::Tile::TSquare
- CLASS Tk::Tile::TSquare
- CLASS Tk::Tile::Treeview
- CLASS Tk::Tile::XScrollbar
- CLASS Tk::Tile::YScrollbar
Methods
- #
- C
- L
- M
- P
- S
- T
Constants
CANNOT_FIND_PACKAGE | = | true |
USE_TILE_NAMESPACE | = | true |
USE_TTK_NAMESPACE | = | false |
TILE_SPEC_VERSION_ID | = | 0 |
PACKAGE_NAME | = | 'tile'.freeze |
Sizegrip | = | SizeGrip |
Button | = | TButton |
TCheckbutton | = | TCheckButton |
CheckButton | = | TCheckButton |
Checkbutton | = | TCheckButton |
Combobox | = | TCombobox |
Entry | = | TEntry |
Frame | = | TFrame |
Label | = | TLabel |
TLabelFrame | = | TLabelframe |
Labelframe | = | TLabelframe |
LabelFrame | = | TLabelframe |
TMenuButton | = | TMenubutton |
Menubutton | = | TMenubutton |
MenuButton | = | TMenubutton |
Notebook | = | TNotebook |
PanedWindow | = | Panedwindow = Paned = TPaned |
Progressbar | = | TProgressbar |
TRadiobutton | = | TRadioButton |
RadioButton | = | TRadioButton |
Radiobutton | = | TRadioButton |
Scale | = | TScale |
Progress | = | TProgress |
Scrollbar | = | TScrollbar |
Separator | = | TSeparator |
Spinbox | = | TSpinbox |
Square | = | TSquare |
Class Public methods
__Import_Tile_Widgets__!()
Link
__define_LoadImages_proc_for_compatibility__!()
Link
# File ext/tk/lib/tkextlib/tile.rb, line 133 def self.__define_LoadImages_proc_for_compatibility__! # Ttk 8.5 (Tile 0.8) lost 'LoadImages' utility procedure. # So, some old scripts doen't work, because those scripts use the # procedure to define local styles. # Of course, rewriting such Tcl/Tk scripts isn't difficult for # Tcl/Tk users. However, it may be troublesome for Ruby/Tk users # who use such Tcl/Tk scripts as it is. # This method may help Ruby/Tk users who don't want to modify old # Tcl/Tk scripts for the latest version of Ttk (Tile) extension. # This method defines a comaptible 'LoadImages' procedure on the # Tcl/Tk interpreter working under Ruby/Tk. # Please give attention to use this method. It may conflict with # some definitions on Tcl/Tk scripts. klass_name = self.name proc_name = 'LoadImages' if Tk::Tile::USE_TTK_NAMESPACE ns_list = ['::tile'] if Tk.info(:commands, "::ttk::#{proc_name}").empty? ns_list << '::ttk' end else # Tk::Tile::USE_TILE_NAMESPACE ns_list = ['::ttk'] if Tk.info(:commands, "::tile::#{proc_name}").empty? ns_list << '::tile' end end ns_list.each{|ns| cmd = "#{ns}::#{proc_name}" unless Tk.info(:commands, cmd).empty? #fail RuntimeError, "can't define '#{cmd}' command (already exist)" # do nothing !!! warn "Warning: can't define '#{cmd}' command (already exist)" if $DEBUG next end TkNamespace.eval(ns){ TkCore::INTERP.add_tk_procs(proc_name, 'imgdir {patterns {*.gif}}', " foreach pattern $patterns { foreach file [glob -directory $imgdir $pattern] { set img [file tail [file rootname $file]] if {![info exists images($img)]} { set images($img) [image create photo -file $file] } } } return [array get images] ") } } end
const_missing(sym)
Link
load_images(imgdir, pat=nil)
Link
# File ext/tk/lib/tkextlib/tile.rb, line 186 def self.load_images(imgdir, pat=nil) if Tk::Tile::TILE_SPEC_VERSION_ID < 8 if Tk::Tile::USE_TTK_NAMESPACE cmd = '::ttk::LoadImages' else # Tk::Tile::USE_TILE_NAMESPACE cmd = '::tile::LoadImages' end pat ||= TkComm::None images = Hash[*TkComm.simplelist(Tk.tk_call(cmd, imgdir, pat))] images.keys.each{|k| images[k] = TkPhotoImage.new(:imagename=>images[k], :without_creating=>true) } else ## TILE_SPEC_VERSION_ID >= 8 pat ||= '*.gif' if pat.kind_of?(Array) pat_list = pat else pat_list = [ pat ] end Dir.chdir(imgdir){ pat_list.each{|pat| Dir.glob(pat).each{|f| img = File.basename(f, '.*') unless TkComm.bool(Tk.info('exists', "images(#{img})")) Tk.tk_call('set', "images(#{img})", Tk.tk_call('image', 'create', 'photo', '-file', f)) end } } } images = Hash[*TkComm.simplelist(Tk.tk_call('array', 'get', 'images'))] images.keys.each{|k| images[k] = TkPhotoImage.new(:imagename=>images[k], :without_creating=>true) } end images end
method_missing(*args)
Link
package_name()
Link
package_version()
Link
set_theme(theme)
Link
# File ext/tk/lib/tkextlib/tile.rb, line 249 def self.set_theme(theme) if TILE_SPEC_VERSION_ID < 8 && Tk.info(:commands, '::ttk::setTheme').empty? cmd = '::tile::setTheme' else cmd = '::ttk::setTheme' end begin Tk.tk_call_without_enc(cmd, theme) rescue Tk::Tile::Style.theme_use(theme) end end
style(*args)
Link
themes(glob_ptn = nil)
Link
# File ext/tk/lib/tkextlib/tile.rb, line 231 def self.themes(glob_ptn = nil) if TILE_SPEC_VERSION_ID < 8 && Tk.info(:commands, '::ttk::themes').empty? fail RuntimeError, 'not support glob option' if glob_ptn cmd = ['::tile::availableThemes'] else glob_ptn = '*' unless glob_ptn cmd = ['::ttk::themes', glob_ptn] end begin TkComm.simplelist(Tk.tk_call_without_enc(*cmd)) rescue TkComm.simplelist(Tk.tk_call('lsearch', '-all', '-inline', Tk::Tile::Style.theme_names, glob_ptn)) end end