methods to control default widget set

string with Tcl's encoding

ttk_selector

toplevel classes/modules

autoload

tkextlib/tcllib/tablelist_core.rb

                            by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

* Part of tcllib extension
* This file is required by 'tkextlib/tcllib/tablelist.rb' or
  'tkextlib/tcllib/tablelist_tile.rb'.

autoload

release date of tkextlib

autoload

create module/class

create module/class

create module/class

Namespace
Methods
B
E
G
P
U
#
C
D
E
L
T
W
Constants
Checkbutton = Tk::CheckButton
 
Labelframe = Tk::LabelFrame
 
CloneMenu = Tk::MenuClone
 
MenuButton = Tk::Menubutton
 
OptionMenuButton = Tk::OptionMenubutton
 
Panedwindow = Tk::PanedWindow
 
Radiobutton = Tk::RadioButton
 
X_Scrollable = XScrollable
 
Y_Scrollable = YScrollable
 
AUTO_PATH = TkVarAccess.new('auto_path', auto_path)
 
TCL_PACKAGE_PATH = TkVarAccess.new('tcl_pkgPath')
 

AUTO_OLDPATH = tk_split_simplelist(INTERP._invoke('set', 'auto_oldpath')) AUTO_OLDPATH.each{|s| s.freeze} AUTO_OLDPATH.freeze

PACKAGE_PATH = TCL_PACKAGE_PATH
 
TCL_LIBRARY_PATH = TkVarAccess.new('tcl_libPath')
 
LIBRARY_PATH = TCL_LIBRARY_PATH
 
TCL_PRECISION = TkVarAccess.new('tcl_precision')
 
TreeCtrl_Widget = TreeCtrl
 
Tkextlib_RELEASE_DATE = '2010-02-01'.freeze
 
INTERP = TkCore::INTERP
 

#<RDoc::Comment:0x007f194ba18a40>


#<RDoc::Comment:0x007f19404ae0d8>


#<RDoc::Comment:0x007f19407f1380>


#<RDoc::Comment:0x007f1940a3ec50>


#<RDoc::Comment:0x007f1940bf3118>


#<RDoc::Comment:0x007f1940e59808>


#<RDoc::Comment:0x007f194120d0d0>


#<RDoc::Comment:0x007f194144a140>


#<RDoc::Comment:0x007f194357a860>


#<RDoc::Comment:0x007f1943b2a468>


#<RDoc::Comment:0x007f193e967798>


#<RDoc::Comment:0x007f193eb18920>


#<RDoc::Comment:0x007f193ceb18b8>

MAINLOOP = Thread.new{ mainloop }
 
Class Public methods
BinaryString(str)
# File ext/tk/lib/tk/autoload.rb, line 112
def Tk.BinaryString(str); Tk::BinaryString.new(str); end
EncodedString(str, enc = nil)
# File ext/tk/lib/tk/autoload.rb, line 109
def Tk.EncodedString(str, enc = nil); Tk::EncodedString.new(str, enc); end
UTF8_String(str)
# File ext/tk/lib/tk/autoload.rb, line 115
def Tk.UTF8_String(str); Tk::UTF8_String.new(str); end
cursor_display(parent=None)
# File ext/tk/lib/tkextlib/tcllib/cursor.rb, line 46
def self.cursor_display(parent=None)
  # Pops up a dialog with a listbox containing all the cursor names.
  # Selecting a cursor name will display it in that dialog.
  # This is simply for viewing any available cursors on the platform .
  #tk_call_without_enc('::cursor::display', parent)
  Tk::Tcllib::Cursor.cursor_display(parent)
end
load_tclscript_rsrc(resource_name, file=None)
# File ext/tk/lib/tk/macpkg.rb, line 12
def Tk.load_tclscript_rsrc(resource_name, file=None)
  # Mac only
  tk_call('source', '-rsrc', resource_name, file)
end
load_tclscript_rsrcid(resource_id, file=None)
# File ext/tk/lib/tk/macpkg.rb, line 17
def Tk.load_tclscript_rsrcid(resource_id, file=None)
  # Mac only
  tk_call('source', '-rsrcid', resource_id, file)
end
Instance Public methods
Grid(*args)
# File ext/tk/lib/tk/autoload.rb, line 8
def Grid(*args); TkGrid.configure(*args); end
Pack(*args)
# File ext/tk/lib/tk/autoload.rb, line 11
def Pack(*args); TkPack.configure(*args); end
Place(*args)
# File ext/tk/lib/tk/autoload.rb, line 14
def Place(*args); TkPlace.configure(*args); end
__create_widget_set__(new_set, src_set={})
# File ext/tk/lib/tk/autoload.rb, line 720
def __create_widget_set__(new_set, src_set={})
  new_set = new_set.to_sym
  if @TOPLEVEL_ALIAS_TABLE[new_set]
    fail RuntimeError, "A widget-set #{new_set.inspect} is already exist."
  end
  if src_set.kind_of?(Symbol)
    # new_set is an alias name of existed widget set.
    @TOPLEVEL_ALIAS_TABLE[new_set] = @TOPLEVEL_ALIAS_TABLE[src_set]
  else
    @TOPLEVEL_ALIAS_TABLE[new_set] = {}
    src_set.each{|sym, obj| set_topalias(new_set, obj, sym.to_sym) }
  end
end
__disable_toplevel_control__(*symbols)
# File ext/tk/lib/tk/autoload.rb, line 716
def __disable_toplevel_control__(*symbols)
  symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER[sym.to_sym] = false}
end
__import_toplevel_aliases__(target, *symbols)
# File ext/tk/lib/tk/autoload.rb, line 667
def __import_toplevel_aliases__(target, *symbols)
  current = @current_default_widget_set
  symbols.each{|sym|
    sym = sym.to_sym
    if (obj = @TOPLEVEL_ALIAS_TABLE[target][sym]).nil?
      # remove
      @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
      @TOPLEVEL_ALIAS_OWNER.delete(sym)
      Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)
      Object.class_eval{remove_const sym} if topobj_defined?(sym)

    elsif obj == false
      # remove, but OWNER[sym] <- false and not treat Object::sym
      @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
      @TOPLEVEL_ALIAS_OWNER[sym] = false
      Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)

    elsif @TOPLEVEL_ALIAS_OWNER[sym] == false
      # Object::sym is out of control. --> not change
      # Keep OWNER[sym].
      @TOPLEVEL_ALIAS_TABLE[current][sym] = obj
      replace_topalias(sym, obj)

    else
      # new definition under control
      @TOPLEVEL_ALIAS_OWNER[sym] = current
      @TOPLEVEL_ALIAS_TABLE[current][sym] = obj
      replace_topalias(sym, obj)
      replace_topobj(sym, obj)
    end
  }
end
__regist_toplevel_aliases__(target, obj, *symbols)
# File ext/tk/lib/tk/autoload.rb, line 434
def __regist_toplevel_aliases__(target, obj, *symbols)
  # initial regist
  @TOPLEVEL_ALIAS_TABLE[target = target.to_sym] ||= {}
  symbols.each{|sym|
    @TOPLEVEL_ALIAS_TABLE[target][sym = sym.to_sym] = obj
    if !topalias_defined?(sym) || target == @current_default_widget_set
      @TOPLEVEL_ALIAS_OWNER[sym] = target
      replace_topalias(sym, obj)
      replace_topobj(sym, obj) unless obj.kind_of?(String) # NOT autoload
    end
  }
end
__remove_toplevel_aliases__(*symbols)
# File ext/tk/lib/tk/autoload.rb, line 700
def __remove_toplevel_aliases__(*symbols)
  # remove toplevel aliases of current widget set
  current = @current_default_widget_set
  symbols.each{|sym|
    sym = sym.to_sym
    @TOPLEVEL_ALIAS_TABLE[current].delete(sym)
    @TOPLEVEL_ALIAS_OWNER.delete(sym)
    Tk::TOPLEVEL_ALIASES.module_eval{remove_const sym} if topalias_defined?(sym)
    Object.class_eval{remove_const sym} if topobj_defined?(sym)
  }
end
__reset_toplevel_owner__(*symbols)
# File ext/tk/lib/tk/autoload.rb, line 712
def __reset_toplevel_owner__(*symbols)
  symbols.each{|sym| @TOPLEVEL_ALIAS_OWNER.delete(sym.to_sym)}
end
__set_loaded_toplevel_aliases__(autopath, target, obj, *symbols)
# File ext/tk/lib/tk/autoload.rb, line 584
def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols)
  # autopath is an autoload file
  # Currently, this method doesn't support that autoload loads
  # different toplevels between <basename>.rb and <basename>.so extension.
  shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath
  target = target.to_sym
  symbols.map!{|sym| sym.to_sym}

  symbols.each{|sym| regist_sym_for_loaded_file(shortpath, obj, sym) }
  symbols.each{|sym| set_topalias(target, obj, sym)}
end
__set_toplevel_aliases__(target, obj, *symbols)
# File ext/tk/lib/tk/autoload.rb, line 577
def __set_toplevel_aliases__(target, obj, *symbols)
  # obj is a kind of String : define autoload path
  #                  Class  : use the class object
  target = target.to_sym
  symbols.each{|sym| set_topalias(target, obj, sym.to_sym)}
end
__toplevel_alias_setup_proc__(*target_list, &cmd)
# File ext/tk/lib/tk/autoload.rb, line 367
def __toplevel_alias_setup_proc__(*target_list, &cmd)
  target_list.each{|target| @TOPLEVEL_ALIAS_SETUP_PROC[target.to_sym] = cmd}
end
default_widget_set()
# File ext/tk/lib/tk/autoload.rb, line 340
def default_widget_set
  @current_default_widget_set
end
default_widget_set=(target)
# File ext/tk/lib/tk/autoload.rb, line 344
def default_widget_set=(target)
  target = target.to_sym
  return target if target == @current_default_widget_set

  if (cmd = @TOPLEVEL_ALIAS_SETUP_PROC[target])
    cmd.call(target)
  end

  _replace_toplevel_aliases(target)
end
encoding()
# File ext/tk/sample/demos-en/tkencoding.rb, line 38
def encoding
  INTERP.encoding
end
encoding=(name)
# File ext/tk/sample/demos-en/tkencoding.rb, line 34
def encoding=(name)
  INTERP.encoding = name
end
toplevel_aliases_on_widget_set(widget_set)
# File ext/tk/lib/tk/autoload.rb, line 359
def toplevel_aliases_on_widget_set(widget_set)
  if (tbl = @TOPLEVEL_ALIAS_TABLE[widget_set.to_sym])
    tbl.collect{|k, v| (v.nil?)? nil: k}.compact
  else
    fail ArgumentError, "unknown widget_set #{widget_set.to_sym.inspect}"
  end
end
widget_set_symbols()
# File ext/tk/lib/tk/autoload.rb, line 355
def widget_set_symbols
  @TOPLEVEL_ALIAS_TABLE.keys
end