Top Level Namespace

Defined Under Namespace

Modules: MultiTkIp_PseudoToplevel_Evaluable, TclTkLib, Tk, TkBgError, TkBindCore, TkCanvasItemConfig, TkClipboard, TkComm, TkComposite, TkConfigMethod, TkConsole, TkCore, TkEvent, TkGrid, TkItemConfigMethod, TkItemConfigOptkeys, TkItemFontOptkeys, TkKinput, TkListItemConfig, TkManageFocus, TkMenuEntryConfig, TkMenuSpec, TkOptionDB, TkPack, TkPackage, TkPalette, TkPlace, TkSelection, TkTextTagConfig, TkTreatFont, TkTreatItemFont, TkTreatTagFont, TkValidation, TkWinfo, TkXIM, TkcTagAccess Classes: MultiTkIp, MultiTkIp_OK, Object, RemoteTkIp, TclTkIp, TkBindTag, TkBindTagAll, TkBitmapImage, TkDatabaseClass, TkDialog, TkDialogObj, TkFont, TkImage, TkMenubar, TkMsgCatalog, TkNamedFont, TkNamespace, TkObject, TkPhotoImage, TkPixmapImage, TkRTTimer, TkScrollbox, TkTextImage, TkTextMark, TkTextMarkAnchor, TkTextMarkCurrent, TkTextMarkInsert, TkTextNamedMark, TkTextNamedTag, TkTextTag, TkTextTagSel, TkTextWin, TkTextWindow, TkTimer, TkValidateCommand, TkVarAccess, TkVariable, TkVirtualEvent, TkWarning, TkWarningObj, TkWindow, TkcArc, TkcBitmap, TkcGroup, TkcImage, TkcItem, TkcLine, TkcOval, TkcPolygon, TkcRectangle, TkcTag, TkcTagAll, TkcTagCurrent, TkcTagString, TkcText, TkcWindow

Constant Summary collapse

TkSystemMenu =
Tk::SystemMenu
TkRoot =
Tk::Root
TopLevel =
TkToplevel
Frame =
TkFrame
Label =
TkLabel
Button =
TkButton
Radiobutton =
TkRadioButton
Checkbutton =
TkCheckButton
Message =
TkMessage
Entry =
TkEntry
Spinbox =
TkSpinbox
Text =
TkText
Scale =
TkScale
Scrollbar =
TkScrollbar
Listbox =
TkListbox
TkMenu
TkMenubutton
Canvas =
TkCanvas
Arc =
TkcArc
Bitmap =
TkcBitmap
Line =
TkcLine
Oval =
TkcOval
Polygon =
TkcPolygon
Rectangle =
TkcRectangle
TextItem =
TkcText
WindowItem =
TkcWindow
BitmapImage =
TkBitmapImage
PhotoImage =
TkPhotoImage
Selection =
TkSelection
Winfo =
TkWinfo
Pack =
TkPack
Grid =
TkGrid
Place =
TkPlace
Variable =
TkVariable
Font =
TkFont
VirtualEvent =
TkVirtualEvent
TkAfter =
TkTimer
TkDialog2 =
TkDialogObj
TkWarning2 =
TkWarningObj
TkMsgCat =
TkMsgCatalog
TktTag =
TkTextTag
TktNamedTag =
TkTextNamedTag
TktTagSel =
TkTextTagSel
TkOption =
TkOptionDB
TkResourceDB =
TkOptionDB
TktMark =
TkTextMark
TktNamedMark =
TkTextNamedMark
TktMarkInsert =
TkTextMarkInsert
TktMarkCurrent =
TkTextMarkCurrent
TktMarkAnchor =
TkTextMarkAnchor
TkcNamedTag =
TkcTagString
TktImage =
TkTextImage
TkNamedVirtualEvent =
TkVirtualEvent::PreDefVirtEvent
TktWindow =
TkTextWindow
Ttk =
Tk::Tile
TkWidget =
TkWindow

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.__getipObject



1290
1291
1292
# File 'lib/tk.rb', line 1290

def INTERP.__getip
  self
end

.add_tk_procs(name, args = nil, body = nil) ⇒ Object



1395
1396
1397
1398
1399
1400
1401
1402
1403
# File 'lib/tk.rb', line 1395

def INTERP.add_tk_procs(name, args = nil, body = nil)
  if name.kind_of?(Array)
    name.each{|param| self.add_tk_procs(*param)}
  else
    name = name.to_s
    @add_tk_procs << [name, args, body]
    self._invoke('proc', name, args, body) if args && body
  end
end

.cb_entry_classObject



1344
1345
1346
# File 'lib/tk.rb', line 1344

def INTERP.cb_entry_class
  @cb_entry_class
end

.cb_eval(cmd, *args) ⇒ Object



1387
1388
1389
# File 'lib/tk.rb', line 1387

def INTERP.cb_eval(cmd, *args)
  TkUtil._get_eval_string(TkUtil.eval_cmd(cmd, *args))
end

.create_tableObject



1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
# File 'lib/tk.rb', line 1370

def INTERP.create_table
  id = @tk_table_list.size
  (tbl = {}).tainted? || TkUtil.untrust(tbl)
  @tk_table_list << tbl
#      obj = Object.new
#      obj.instance_eval <<-EOD
#        def self.method_missing(m, *args)
#         TkCore::INTERP.tk_object_table(#{id}).send(m, *args)
#        end
#      EOD
#      return obj
  Tk_OBJECT_TABLE.new(id)
end

.default_master?Boolean

Returns:

  • (Boolean)


1293
1294
1295
# File 'lib/tk.rb', line 1293

def INTERP.default_master?
  true
end

.get_cb_entry(cmd) ⇒ Object



1384
1385
1386
# File 'lib/tk.rb', line 1384

def INTERP.get_cb_entry(cmd)
  @cb_entry_class.new(__getip, cmd).freeze
end

.init_ip_env(script = Proc.new) ⇒ Object



1391
1392
1393
1394
# File 'lib/tk.rb', line 1391

def INTERP.init_ip_env(script = Proc.new)
  @init_ip_env << script
  script.call(self)
end

.init_ip_internalObject



1414
1415
1416
1417
1418
# File 'lib/tk.rb', line 1414

def INTERP.init_ip_internal
  ip = self
  @init_ip_env.each{|script| script.call(ip)}
  @add_tk_procs.each{|name,args,body| ip._invoke('proc',name,args,body)}
end

.remove_tk_procs(*names) ⇒ Object



1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
# File 'lib/tk.rb', line 1404

def INTERP.remove_tk_procs(*names)
  names.each{|name|
    name = name.to_s
    @add_tk_procs.delete_if{|elem|
      elem.kind_of?(Array) && elem[0].to_s == name
    }
    #self._invoke('rename', name, '')
    self.__invoke__('rename', name, '')
  }
end

.tk_cmd_tblObject



1347
1348
1349
# File 'lib/tk.rb', line 1347

def INTERP.tk_cmd_tbl
  @tk_cmd_tbl
end

.tk_object_table(id) ⇒ Object



1367
1368
1369
# File 'lib/tk.rb', line 1367

def INTERP.tk_object_table(id)
  @tk_table_list[id]
end

.tk_windowsObject



1350
1351
1352
# File 'lib/tk.rb', line 1350

def INTERP.tk_windows
  @tk_windows
end

Instance Method Details

#check_pkg(file, verbose = false) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/tkextlib/pkg_checker.rb', line 91

def check_pkg(file, verbose=false)
  pkg_list = get_pkg_list(file)

  error_list = []
  success_list = {}

  pkg_list.each{|name, type|
    next if success_list[name]

    begin
      case type
      when :package
        ver = TkPackage.require(name)
        success_list[name] = ver
        error_list.delete_if{|n, t| n == name}

      when :library
        Tk.load_tcllibrary(name)
        success_list[name] = :library
        error_list.delete_if{|n, t| n == name}

      when :script
        Tk.load_tclscript(name)
        success_list[name] = :script
        error_list.delete_if{|n, t| n == name}

      when :require_ruby_lib
        require name

      end
    rescue => e
      if verbose
        error_list << [name, type, e.message]
      else
        error_list << [name, type]
      end
    end
  }

  success_list.dup.each{|name, ver|
    unless ver.kind_of?(String)
      begin
        ver = TkPackage.require(name)
        sccess_list[name] = ver
      rescue
      end
    end
  }

  [success_list, error_list]
end

#get_pkg_list(file) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/tkextlib/pkg_checker.rb', line 66

def get_pkg_list(file)
  pkg_list = []

  File.foreach(file){|l|
    if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)TkPackage\s*\.\s*require\s*\(?\s*(["'])((\w|:)+)\1/
      pkg = [$2, :package]
      pkg_list << pkg unless pkg_list.member?(pkg)
    end
    if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)Tk\s*\.\s*load_tcllibrary\s*\(?\s*(["'])((\w|:)+)\1/
      pkg = [$2, :library]
      pkg_list << pkg unless pkg_list.member?(pkg)
    end
    if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)Tk\s*\.\s*load_tclscript\s*\(?\s*(["'])((\w|:)+)\1/
      pkg = [$2, :script]
      pkg_list << pkg unless pkg_list.member?(pkg)
    end
    if l =~ /^(?:[^#]+\s|\s*)(?:|;\s*)require\s*\(?\s*(["'])((\w|\/|:)+)\1/
      pkg = [$2, :require_ruby_lib]
      pkg_list << pkg unless pkg_list.member?(pkg)
    end
  }

  pkg_list
end

#help_msgObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/tkextlib/pkg_checker.rb', line 16

def help_msg
  print "Usage: #{$0} [-l] [-v] [-h] [--] [dir]\n"
  print "\tIf dir is omitted, check the directry that this command exists.\n"
  print "\tAvailable options are \n"
  print "\t  -l : Add dir to $LOAD_PATH\n"
  print "\t       (If dir == '<parent>/tkextlib', add <parent> also.)\n"
  print "\t  -v : Verbose mode (show reason of fail)\n"
  print "\t  -h : Show this message\n"
  print "\t  -- : End of options\n"
end

#MainloopObject



45
46
47
# File 'lib/tkclass.rb', line 45

def Mainloop
  Tk.mainloop
end

#subdir_check(dir, verbose = false) ⇒ Object



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/tkextlib/pkg_checker.rb', line 143

def subdir_check(dir, verbose=false)
  Dir.foreach(dir){|f|
    next if f == '.' || f == '..'
    if File.directory?(f)
      subdir_check(File.join(dir, f))
    elsif File.extname(f) == '.rb'
      path = File.join(dir, f)
      suc, err = check_pkg(path, verbose)
      if err.empty?
        print 'Ready : ', path, ' : require->', suc.inspect, "\n"
      else
        print '*LACK : ', path, ' : require->', suc.inspect,
          '  FAIL->', err.inspect, "\n"
      end
    end
  }
end

#TkGrid(*args) ⇒ Object



18
# File 'lib/tk/autoload.rb', line 18

def TkGrid(*args); TkGrid.configure(*args); end

#TkPack(*args) ⇒ Object



21
# File 'lib/tk/autoload.rb', line 21

def TkPack(*args); TkPack.configure(*args); end

#TkPlace(*args) ⇒ Object



24
# File 'lib/tk/autoload.rb', line 24

def TkPlace(*args); TkPlace.configure(*args); end