tk_as_gem 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +22 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/ext/ChangeLog.tkextlib +935 -0
- data/ext/MANUAL_tcltklib.eng +469 -0
- data/ext/MANUAL_tcltklib.eucj +579 -0
- data/ext/README.1st +19 -0
- data/ext/README.ActiveTcl +49 -0
- data/ext/README.fork +34 -0
- data/ext/README.macosx-aqua +67 -0
- data/ext/README.tcltklib +85 -0
- data/ext/depend +2 -0
- data/ext/extconf.rb +451 -0
- data/ext/lib/README +30 -0
- data/ext/lib/multi-tk.rb +3491 -0
- data/ext/lib/remote-tk.rb +530 -0
- data/ext/lib/tcltk.rb +367 -0
- data/ext/lib/tk.rb +5584 -0
- data/ext/lib/tk/after.rb +6 -0
- data/ext/lib/tk/autoload.rb +414 -0
- data/ext/lib/tk/bgerror.rb +29 -0
- data/ext/lib/tk/bindtag.rb +138 -0
- data/ext/lib/tk/button.rb +30 -0
- data/ext/lib/tk/canvas.rb +789 -0
- data/ext/lib/tk/canvastag.rb +434 -0
- data/ext/lib/tk/checkbutton.rb +30 -0
- data/ext/lib/tk/clipboard.rb +75 -0
- data/ext/lib/tk/clock.rb +71 -0
- data/ext/lib/tk/composite.rb +458 -0
- data/ext/lib/tk/console.rb +52 -0
- data/ext/lib/tk/dialog.rb +326 -0
- data/ext/lib/tk/encodedstr.rb +187 -0
- data/ext/lib/tk/entry.rb +119 -0
- data/ext/lib/tk/event.rb +542 -0
- data/ext/lib/tk/font.rb +2344 -0
- data/ext/lib/tk/frame.rb +131 -0
- data/ext/lib/tk/grid.rb +279 -0
- data/ext/lib/tk/image.rb +275 -0
- data/ext/lib/tk/itemconfig.rb +1215 -0
- data/ext/lib/tk/itemfont.rb +327 -0
- data/ext/lib/tk/kinput.rb +71 -0
- data/ext/lib/tk/label.rb +21 -0
- data/ext/lib/tk/labelframe.rb +29 -0
- data/ext/lib/tk/listbox.rb +282 -0
- data/ext/lib/tk/macpkg.rb +78 -0
- data/ext/lib/tk/menu.rb +681 -0
- data/ext/lib/tk/menubar.rb +131 -0
- data/ext/lib/tk/menuspec.rb +275 -0
- data/ext/lib/tk/message.rb +22 -0
- data/ext/lib/tk/mngfocus.rb +33 -0
- data/ext/lib/tk/msgcat.rb +296 -0
- data/ext/lib/tk/namespace.rb +551 -0
- data/ext/lib/tk/optiondb.rb +377 -0
- data/ext/lib/tk/optionobj.rb +212 -0
- data/ext/lib/tk/pack.rb +107 -0
- data/ext/lib/tk/package.rb +143 -0
- data/ext/lib/tk/palette.rb +55 -0
- data/ext/lib/tk/panedwindow.rb +258 -0
- data/ext/lib/tk/place.rb +128 -0
- data/ext/lib/tk/radiobutton.rb +71 -0
- data/ext/lib/tk/root.rb +95 -0
- data/ext/lib/tk/scale.rb +111 -0
- data/ext/lib/tk/scrollable.rb +82 -0
- data/ext/lib/tk/scrollbar.rb +177 -0
- data/ext/lib/tk/scrollbox.rb +39 -0
- data/ext/lib/tk/selection.rb +86 -0
- data/ext/lib/tk/spinbox.rb +119 -0
- data/ext/lib/tk/tagfont.rb +43 -0
- data/ext/lib/tk/text.rb +1596 -0
- data/ext/lib/tk/textimage.rb +88 -0
- data/ext/lib/tk/textmark.rb +204 -0
- data/ext/lib/tk/texttag.rb +318 -0
- data/ext/lib/tk/textwindow.rb +154 -0
- data/ext/lib/tk/timer.rb +669 -0
- data/ext/lib/tk/toplevel.rb +262 -0
- data/ext/lib/tk/ttk_selector.rb +76 -0
- data/ext/lib/tk/txtwin_abst.rb +39 -0
- data/ext/lib/tk/validation.rb +397 -0
- data/ext/lib/tk/variable.rb +1765 -0
- data/ext/lib/tk/virtevent.rb +139 -0
- data/ext/lib/tk/winfo.rb +392 -0
- data/ext/lib/tk/winpkg.rb +153 -0
- data/ext/lib/tk/wm.rb +552 -0
- data/ext/lib/tk/xim.rb +122 -0
- data/ext/lib/tkafter.rb +4 -0
- data/ext/lib/tkbgerror.rb +4 -0
- data/ext/lib/tkcanvas.rb +4 -0
- data/ext/lib/tkclass.rb +47 -0
- data/ext/lib/tkconsole.rb +4 -0
- data/ext/lib/tkdialog.rb +4 -0
- data/ext/lib/tkentry.rb +4 -0
- data/ext/lib/tkextlib/ICONS.rb +13 -0
- data/ext/lib/tkextlib/ICONS/icons.rb +129 -0
- data/ext/lib/tkextlib/ICONS/setup.rb +8 -0
- data/ext/lib/tkextlib/SUPPORT_STATUS +196 -0
- data/ext/lib/tkextlib/blt.rb +187 -0
- data/ext/lib/tkextlib/blt/barchart.rb +79 -0
- data/ext/lib/tkextlib/blt/bitmap.rb +112 -0
- data/ext/lib/tkextlib/blt/busy.rb +82 -0
- data/ext/lib/tkextlib/blt/component.rb +2145 -0
- data/ext/lib/tkextlib/blt/container.rb +28 -0
- data/ext/lib/tkextlib/blt/cutbuffer.rb +23 -0
- data/ext/lib/tkextlib/blt/dragdrop.rb +268 -0
- data/ext/lib/tkextlib/blt/eps.rb +32 -0
- data/ext/lib/tkextlib/blt/graph.rb +67 -0
- data/ext/lib/tkextlib/blt/htext.rb +111 -0
- data/ext/lib/tkextlib/blt/setup.rb +8 -0
- data/ext/lib/tkextlib/blt/spline.rb +23 -0
- data/ext/lib/tkextlib/blt/stripchart.rb +74 -0
- data/ext/lib/tkextlib/blt/table.rb +399 -0
- data/ext/lib/tkextlib/blt/tabnotebook.rb +110 -0
- data/ext/lib/tkextlib/blt/tabset.rb +500 -0
- data/ext/lib/tkextlib/blt/ted.rb +65 -0
- data/ext/lib/tkextlib/blt/tile.rb +21 -0
- data/ext/lib/tkextlib/blt/tile/button.rb +16 -0
- data/ext/lib/tkextlib/blt/tile/checkbutton.rb +17 -0
- data/ext/lib/tkextlib/blt/tile/frame.rb +16 -0
- data/ext/lib/tkextlib/blt/tile/label.rb +16 -0
- data/ext/lib/tkextlib/blt/tile/radiobutton.rb +17 -0
- data/ext/lib/tkextlib/blt/tile/scrollbar.rb +16 -0
- data/ext/lib/tkextlib/blt/tile/toplevel.rb +16 -0
- data/ext/lib/tkextlib/blt/tree.rb +1058 -0
- data/ext/lib/tkextlib/blt/treeview.rb +1272 -0
- data/ext/lib/tkextlib/blt/unix_dnd.rb +135 -0
- data/ext/lib/tkextlib/blt/vector.rb +256 -0
- data/ext/lib/tkextlib/blt/watch.rb +175 -0
- data/ext/lib/tkextlib/blt/win_printer.rb +61 -0
- data/ext/lib/tkextlib/blt/winop.rb +107 -0
- data/ext/lib/tkextlib/bwidget.rb +151 -0
- data/ext/lib/tkextlib/bwidget/arrowbutton.rb +21 -0
- data/ext/lib/tkextlib/bwidget/bitmap.rb +21 -0
- data/ext/lib/tkextlib/bwidget/button.rb +31 -0
- data/ext/lib/tkextlib/bwidget/buttonbox.rb +90 -0
- data/ext/lib/tkextlib/bwidget/combobox.rb +51 -0
- data/ext/lib/tkextlib/bwidget/dialog.rb +182 -0
- data/ext/lib/tkextlib/bwidget/dragsite.rb +31 -0
- data/ext/lib/tkextlib/bwidget/dropsite.rb +39 -0
- data/ext/lib/tkextlib/bwidget/dynamichelp.rb +63 -0
- data/ext/lib/tkextlib/bwidget/entry.rb +43 -0
- data/ext/lib/tkextlib/bwidget/label.rb +41 -0
- data/ext/lib/tkextlib/bwidget/labelentry.rb +80 -0
- data/ext/lib/tkextlib/bwidget/labelframe.rb +52 -0
- data/ext/lib/tkextlib/bwidget/listbox.rb +358 -0
- data/ext/lib/tkextlib/bwidget/mainframe.rb +128 -0
- data/ext/lib/tkextlib/bwidget/messagedlg.rb +192 -0
- data/ext/lib/tkextlib/bwidget/notebook.rb +166 -0
- data/ext/lib/tkextlib/bwidget/pagesmanager.rb +73 -0
- data/ext/lib/tkextlib/bwidget/panedwindow.rb +37 -0
- data/ext/lib/tkextlib/bwidget/panelframe.rb +57 -0
- data/ext/lib/tkextlib/bwidget/passwddlg.rb +44 -0
- data/ext/lib/tkextlib/bwidget/progressbar.rb +20 -0
- data/ext/lib/tkextlib/bwidget/progressdlg.rb +58 -0
- data/ext/lib/tkextlib/bwidget/scrollableframe.rb +40 -0
- data/ext/lib/tkextlib/bwidget/scrolledwindow.rb +38 -0
- data/ext/lib/tkextlib/bwidget/scrollview.rb +25 -0
- data/ext/lib/tkextlib/bwidget/selectcolor.rb +73 -0
- data/ext/lib/tkextlib/bwidget/selectfont.rb +86 -0
- data/ext/lib/tkextlib/bwidget/separator.rb +20 -0
- data/ext/lib/tkextlib/bwidget/setup.rb +8 -0
- data/ext/lib/tkextlib/bwidget/spinbox.rb +98 -0
- data/ext/lib/tkextlib/bwidget/statusbar.rb +52 -0
- data/ext/lib/tkextlib/bwidget/titleframe.rb +33 -0
- data/ext/lib/tkextlib/bwidget/tree.rb +453 -0
- data/ext/lib/tkextlib/bwidget/widget.rb +129 -0
- data/ext/lib/tkextlib/itcl.rb +13 -0
- data/ext/lib/tkextlib/itcl/incr_tcl.rb +178 -0
- data/ext/lib/tkextlib/itcl/setup.rb +13 -0
- data/ext/lib/tkextlib/itk.rb +13 -0
- data/ext/lib/tkextlib/itk/incr_tk.rb +446 -0
- data/ext/lib/tkextlib/itk/setup.rb +13 -0
- data/ext/lib/tkextlib/iwidgets.rb +94 -0
- data/ext/lib/tkextlib/iwidgets/buttonbox.rb +120 -0
- data/ext/lib/tkextlib/iwidgets/calendar.rb +125 -0
- data/ext/lib/tkextlib/iwidgets/canvasprintbox.rb +53 -0
- data/ext/lib/tkextlib/iwidgets/canvasprintdialog.rb +38 -0
- data/ext/lib/tkextlib/iwidgets/checkbox.rb +129 -0
- data/ext/lib/tkextlib/iwidgets/combobox.rb +104 -0
- data/ext/lib/tkextlib/iwidgets/dateentry.rb +20 -0
- data/ext/lib/tkextlib/iwidgets/datefield.rb +58 -0
- data/ext/lib/tkextlib/iwidgets/dialog.rb +20 -0
- data/ext/lib/tkextlib/iwidgets/dialogshell.rb +120 -0
- data/ext/lib/tkextlib/iwidgets/disjointlistbox.rb +50 -0
- data/ext/lib/tkextlib/iwidgets/entryfield.rb +185 -0
- data/ext/lib/tkextlib/iwidgets/extbutton.rb +40 -0
- data/ext/lib/tkextlib/iwidgets/extfileselectionbox.rb +46 -0
- data/ext/lib/tkextlib/iwidgets/extfileselectiondialog.rb +33 -0
- data/ext/lib/tkextlib/iwidgets/feedback.rb +35 -0
- data/ext/lib/tkextlib/iwidgets/fileselectionbox.rb +46 -0
- data/ext/lib/tkextlib/iwidgets/fileselectiondialog.rb +33 -0
- data/ext/lib/tkextlib/iwidgets/finddialog.rb +42 -0
- data/ext/lib/tkextlib/iwidgets/hierarchy.rb +365 -0
- data/ext/lib/tkextlib/iwidgets/hyperhelp.rb +50 -0
- data/ext/lib/tkextlib/iwidgets/labeledframe.rb +39 -0
- data/ext/lib/tkextlib/iwidgets/labeledwidget.rb +45 -0
- data/ext/lib/tkextlib/iwidgets/mainwindow.rb +67 -0
- data/ext/lib/tkextlib/iwidgets/menubar.rb +211 -0
- data/ext/lib/tkextlib/iwidgets/messagebox.rb +92 -0
- data/ext/lib/tkextlib/iwidgets/messagedialog.rb +20 -0
- data/ext/lib/tkextlib/iwidgets/notebook.rb +174 -0
- data/ext/lib/tkextlib/iwidgets/optionmenu.rb +92 -0
- data/ext/lib/tkextlib/iwidgets/panedwindow.rb +133 -0
- data/ext/lib/tkextlib/iwidgets/promptdialog.rb +131 -0
- data/ext/lib/tkextlib/iwidgets/pushbutton.rb +35 -0
- data/ext/lib/tkextlib/iwidgets/radiobox.rb +120 -0
- data/ext/lib/tkextlib/iwidgets/scopedobject.rb +24 -0
- data/ext/lib/tkextlib/iwidgets/scrolledcanvas.rb +353 -0
- data/ext/lib/tkextlib/iwidgets/scrolledframe.rb +59 -0
- data/ext/lib/tkextlib/iwidgets/scrolledhtml.rb +58 -0
- data/ext/lib/tkextlib/iwidgets/scrolledlistbox.rb +207 -0
- data/ext/lib/tkextlib/iwidgets/scrolledtext.rb +564 -0
- data/ext/lib/tkextlib/iwidgets/scrolledwidget.rb +20 -0
- data/ext/lib/tkextlib/iwidgets/selectionbox.rb +102 -0
- data/ext/lib/tkextlib/iwidgets/selectiondialog.rb +92 -0
- data/ext/lib/tkextlib/iwidgets/setup.rb +8 -0
- data/ext/lib/tkextlib/iwidgets/shell.rb +38 -0
- data/ext/lib/tkextlib/iwidgets/spindate.rb +48 -0
- data/ext/lib/tkextlib/iwidgets/spinint.rb +30 -0
- data/ext/lib/tkextlib/iwidgets/spinner.rb +169 -0
- data/ext/lib/tkextlib/iwidgets/spintime.rb +48 -0
- data/ext/lib/tkextlib/iwidgets/tabnotebook.rb +180 -0
- data/ext/lib/tkextlib/iwidgets/tabset.rb +144 -0
- data/ext/lib/tkextlib/iwidgets/timeentry.rb +25 -0
- data/ext/lib/tkextlib/iwidgets/timefield.rb +58 -0
- data/ext/lib/tkextlib/iwidgets/toolbar.rb +112 -0
- data/ext/lib/tkextlib/iwidgets/watch.rb +56 -0
- data/ext/lib/tkextlib/pkg_checker.rb +184 -0
- data/ext/lib/tkextlib/setup.rb +8 -0
- data/ext/lib/tkextlib/tcllib.rb +90 -0
- data/ext/lib/tkextlib/tcllib/README +135 -0
- data/ext/lib/tkextlib/tcllib/autoscroll.rb +158 -0
- data/ext/lib/tkextlib/tcllib/ctext.rb +160 -0
- data/ext/lib/tkextlib/tcllib/cursor.rb +97 -0
- data/ext/lib/tkextlib/tcllib/datefield.rb +57 -0
- data/ext/lib/tkextlib/tcllib/dialog.rb +84 -0
- data/ext/lib/tkextlib/tcllib/getstring.rb +134 -0
- data/ext/lib/tkextlib/tcllib/history.rb +73 -0
- data/ext/lib/tkextlib/tcllib/ico.rb +116 -0
- data/ext/lib/tkextlib/tcllib/ip_entry.rb +66 -0
- data/ext/lib/tkextlib/tcllib/panelframe.rb +72 -0
- data/ext/lib/tkextlib/tcllib/plotchart.rb +886 -0
- data/ext/lib/tkextlib/tcllib/ruler.rb +65 -0
- data/ext/lib/tkextlib/tcllib/screenruler.rb +68 -0
- data/ext/lib/tkextlib/tcllib/scrollwin.rb +61 -0
- data/ext/lib/tkextlib/tcllib/setup.rb +8 -0
- data/ext/lib/tkextlib/tcllib/style.rb +61 -0
- data/ext/lib/tkextlib/tcllib/superframe.rb +51 -0
- data/ext/lib/tkextlib/tcllib/swaplist.rb +150 -0
- data/ext/lib/tkextlib/tcllib/tablelist.rb +27 -0
- data/ext/lib/tkextlib/tcllib/tablelist_core.rb +782 -0
- data/ext/lib/tkextlib/tcllib/tablelist_tile.rb +25 -0
- data/ext/lib/tkextlib/tcllib/tkpiechart.rb +314 -0
- data/ext/lib/tkextlib/tcllib/tooltip.rb +95 -0
- data/ext/lib/tkextlib/tcllib/widget.rb +48 -0
- data/ext/lib/tkextlib/tclx.rb +13 -0
- data/ext/lib/tkextlib/tclx/setup.rb +8 -0
- data/ext/lib/tkextlib/tclx/tclx.rb +74 -0
- data/ext/lib/tkextlib/tile.rb +419 -0
- data/ext/lib/tkextlib/tile/dialog.rb +96 -0
- data/ext/lib/tkextlib/tile/setup.rb +8 -0
- data/ext/lib/tkextlib/tile/sizegrip.rb +29 -0
- data/ext/lib/tkextlib/tile/style.rb +316 -0
- data/ext/lib/tkextlib/tile/tbutton.rb +33 -0
- data/ext/lib/tkextlib/tile/tcheckbutton.rb +36 -0
- data/ext/lib/tkextlib/tile/tcombobox.rb +54 -0
- data/ext/lib/tkextlib/tile/tentry.rb +48 -0
- data/ext/lib/tkextlib/tile/tframe.rb +33 -0
- data/ext/lib/tkextlib/tile/tlabel.rb +33 -0
- data/ext/lib/tkextlib/tile/tlabelframe.rb +36 -0
- data/ext/lib/tkextlib/tile/tmenubutton.rb +36 -0
- data/ext/lib/tkextlib/tile/tnotebook.rb +139 -0
- data/ext/lib/tkextlib/tile/tpaned.rb +231 -0
- data/ext/lib/tkextlib/tile/tprogressbar.rb +56 -0
- data/ext/lib/tkextlib/tile/tradiobutton.rb +36 -0
- data/ext/lib/tkextlib/tile/treeview.rb +1239 -0
- data/ext/lib/tkextlib/tile/tscale.rb +53 -0
- data/ext/lib/tkextlib/tile/tscrollbar.rb +54 -0
- data/ext/lib/tkextlib/tile/tseparator.rb +33 -0
- data/ext/lib/tkextlib/tile/tsquare.rb +30 -0
- data/ext/lib/tkextlib/tkDND.rb +18 -0
- data/ext/lib/tkextlib/tkDND/setup.rb +8 -0
- data/ext/lib/tkextlib/tkDND/shape.rb +125 -0
- data/ext/lib/tkextlib/tkDND/tkdnd.rb +182 -0
- data/ext/lib/tkextlib/tkHTML.rb +13 -0
- data/ext/lib/tkextlib/tkHTML/htmlwidget.rb +453 -0
- data/ext/lib/tkextlib/tkHTML/setup.rb +8 -0
- data/ext/lib/tkextlib/tkimg.rb +36 -0
- data/ext/lib/tkextlib/tkimg/README +26 -0
- data/ext/lib/tkextlib/tkimg/bmp.rb +33 -0
- data/ext/lib/tkextlib/tkimg/gif.rb +33 -0
- data/ext/lib/tkextlib/tkimg/ico.rb +33 -0
- data/ext/lib/tkextlib/tkimg/jpeg.rb +33 -0
- data/ext/lib/tkextlib/tkimg/pcx.rb +33 -0
- data/ext/lib/tkextlib/tkimg/pixmap.rb +44 -0
- data/ext/lib/tkextlib/tkimg/png.rb +33 -0
- data/ext/lib/tkextlib/tkimg/ppm.rb +33 -0
- data/ext/lib/tkextlib/tkimg/ps.rb +33 -0
- data/ext/lib/tkextlib/tkimg/setup.rb +8 -0
- data/ext/lib/tkextlib/tkimg/sgi.rb +33 -0
- data/ext/lib/tkextlib/tkimg/sun.rb +33 -0
- data/ext/lib/tkextlib/tkimg/tga.rb +33 -0
- data/ext/lib/tkextlib/tkimg/tiff.rb +33 -0
- data/ext/lib/tkextlib/tkimg/window.rb +33 -0
- data/ext/lib/tkextlib/tkimg/xbm.rb +33 -0
- data/ext/lib/tkextlib/tkimg/xpm.rb +33 -0
- data/ext/lib/tkextlib/tktable.rb +14 -0
- data/ext/lib/tkextlib/tktable/setup.rb +8 -0
- data/ext/lib/tkextlib/tktable/tktable.rb +957 -0
- data/ext/lib/tkextlib/tktrans.rb +14 -0
- data/ext/lib/tkextlib/tktrans/setup.rb +8 -0
- data/ext/lib/tkextlib/tktrans/tktrans.rb +64 -0
- data/ext/lib/tkextlib/treectrl.rb +13 -0
- data/ext/lib/tkextlib/treectrl/setup.rb +8 -0
- data/ext/lib/tkextlib/treectrl/tktreectrl.rb +2461 -0
- data/ext/lib/tkextlib/trofs.rb +13 -0
- data/ext/lib/tkextlib/trofs/setup.rb +8 -0
- data/ext/lib/tkextlib/trofs/trofs.rb +51 -0
- data/ext/lib/tkextlib/version.rb +6 -0
- data/ext/lib/tkextlib/vu.rb +48 -0
- data/ext/lib/tkextlib/vu/bargraph.rb +61 -0
- data/ext/lib/tkextlib/vu/charts.rb +53 -0
- data/ext/lib/tkextlib/vu/dial.rb +102 -0
- data/ext/lib/tkextlib/vu/pie.rb +282 -0
- data/ext/lib/tkextlib/vu/setup.rb +8 -0
- data/ext/lib/tkextlib/vu/spinbox.rb +22 -0
- data/ext/lib/tkextlib/winico.rb +14 -0
- data/ext/lib/tkextlib/winico/setup.rb +8 -0
- data/ext/lib/tkextlib/winico/winico.rb +224 -0
- data/ext/lib/tkfont.rb +4 -0
- data/ext/lib/tkmacpkg.rb +4 -0
- data/ext/lib/tkmenubar.rb +4 -0
- data/ext/lib/tkmngfocus.rb +4 -0
- data/ext/lib/tkpalette.rb +4 -0
- data/ext/lib/tkscrollbox.rb +4 -0
- data/ext/lib/tktext.rb +4 -0
- data/ext/lib/tkvirtevent.rb +4 -0
- data/ext/lib/tkwinpkg.rb +4 -0
- data/ext/old-README.tcltklib.eucj +159 -0
- data/ext/stubs.c +531 -0
- data/ext/stubs.h +33 -0
- data/ext/tcltklib.c +10155 -0
- data/ext/tkutil/.cvsignore +3 -0
- data/ext/tkutil/depend +1 -0
- data/ext/tkutil/extconf.rb +14 -0
- data/ext/tkutil/tkutil.c +1789 -0
- metadata +418 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
#
|
2
|
+
# tkextlib/tcllib/ico.rb
|
3
|
+
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
4
|
+
#
|
5
|
+
# * Part of tcllib extension
|
6
|
+
# * Reading and writing windows icons
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'tk'
|
10
|
+
require 'tk/image'
|
11
|
+
require 'tkextlib/tcllib.rb'
|
12
|
+
|
13
|
+
# TkPackage.require('ico', '0.3')
|
14
|
+
TkPackage.require('ico')
|
15
|
+
|
16
|
+
module Tk
|
17
|
+
module Tcllib
|
18
|
+
class ICO < TkImage
|
19
|
+
PACKAGE_NAME = 'ico'.freeze
|
20
|
+
def self.package_name
|
21
|
+
PACKAGE_NAME
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.package_version
|
25
|
+
begin
|
26
|
+
TkPackage.require('ico')
|
27
|
+
rescue
|
28
|
+
''
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class Tk::Tcllib::ICO
|
36
|
+
def self.list(file, keys=nil)
|
37
|
+
tk_split_list(tk_call_without_enc('::ico::getIconList', file,
|
38
|
+
*hash_kv(keys, true)))
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.get(file, index, keys=nil)
|
42
|
+
tk_call_without_enc('::ico::getIcon', file, index, *hash_kv(keys, true))
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.get_image(file, index, keys={})
|
46
|
+
keys = _symbolkey2str(keys)
|
47
|
+
keys.delete('format')
|
48
|
+
self.new(file, index, keys)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.get_data(file, index, keys={})
|
52
|
+
keys['format'] = 'data'
|
53
|
+
tk_split_list(tk_call_without_enc('::ico::getIcon', file, index,
|
54
|
+
*hash_kv(keys, true)))
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.write(file, index, depth, data, keys=nil)
|
58
|
+
tk_call_without_enc('::ico::writeIcon', file, index, depth, data,
|
59
|
+
*hash_kv(keys, true))
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.copy(from_file, from_index, to_file, to_index, keys=nil)
|
63
|
+
tk_call_without_enc('::ico::copyIcon',
|
64
|
+
from_file, from_index, to_file, to_index,
|
65
|
+
*hash_kv(keys, true))
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.exe_to_ico(exe_file, ico_file, keys=nil)
|
69
|
+
tk_call_without_enc('::ico::copyIcon', exe_file, ico_file,
|
70
|
+
*hash_kv(keys, true))
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.clear_cache(file=None)
|
74
|
+
tk_call_without_enc('::ico::clearCache', file)
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.transparent_color(image, color)
|
78
|
+
if image.kind_of?(Array)
|
79
|
+
tk_split_list(tk_call_without_enc('::ico::transparentColor',
|
80
|
+
image, color))
|
81
|
+
else
|
82
|
+
tk_call_without_enc('::ico::transparentColor', image, color)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.show(file, keys=nil)
|
87
|
+
tk_call_without_enc('::ico::Show', file, *hash_kv(keys, true))
|
88
|
+
end
|
89
|
+
|
90
|
+
###########################
|
91
|
+
|
92
|
+
def initialize(file, index, keys=nil)
|
93
|
+
keys = _symbolkey2str(keys)
|
94
|
+
if keys.key?('name')
|
95
|
+
@path = keys['name'].to_s
|
96
|
+
else
|
97
|
+
Tk_Image_ID.mutex.synchronize{
|
98
|
+
@path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
|
99
|
+
Tk_Image_ID[1].succ!
|
100
|
+
}
|
101
|
+
end
|
102
|
+
tk_call_without_enc('::ico::getIcon', file, index, '-name', @path,
|
103
|
+
'-format', 'image', *hash_kv(keys, true))
|
104
|
+
Tk_IMGTBL[@path] = self
|
105
|
+
end
|
106
|
+
|
107
|
+
def write(file, index, depth, keys=nil)
|
108
|
+
Tk::Tcllib::ICO.write(file, index, depth, @path, keys=nil)
|
109
|
+
self
|
110
|
+
end
|
111
|
+
|
112
|
+
def transparent_color(color)
|
113
|
+
tk_call_without_enc('::ico::transparentColor', @path, color)
|
114
|
+
self
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#
|
2
|
+
# tkextlib/tcllib/ip_entry.rb
|
3
|
+
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
4
|
+
#
|
5
|
+
# * Part of tcllib extension
|
6
|
+
# * An IP address entry widget
|
7
|
+
#
|
8
|
+
# (The following is the original description of the library.)
|
9
|
+
#
|
10
|
+
# This package provides a widget for the entering of a IP address.
|
11
|
+
# It guarantees a valid address at all times.
|
12
|
+
|
13
|
+
require 'tk'
|
14
|
+
require 'tkextlib/tcllib.rb'
|
15
|
+
|
16
|
+
# TkPackage.require('ipentry', '0.1')
|
17
|
+
TkPackage.require('ipentry')
|
18
|
+
|
19
|
+
module Tk
|
20
|
+
module Tcllib
|
21
|
+
class IP_Entry < Tk::Entry
|
22
|
+
PACKAGE_NAME = 'ipentry'.freeze
|
23
|
+
def self.package_name
|
24
|
+
PACKAGE_NAME
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.package_version
|
28
|
+
begin
|
29
|
+
TkPackage.require('ipentry')
|
30
|
+
rescue
|
31
|
+
''
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
IPEntry = IP_Entry
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Tk::Tcllib::IP_Entry
|
40
|
+
TkCommandNames = ['::ipentry::ipentry'.freeze].freeze
|
41
|
+
WidgetClassName = 'IPEntry'.freeze
|
42
|
+
WidgetClassNames[WidgetClassName] = self
|
43
|
+
|
44
|
+
def create_self(keys)
|
45
|
+
if keys and keys != None
|
46
|
+
tk_call_without_enc(self.class::TkCommandNames[0], @path,
|
47
|
+
*hash_kv(keys, true))
|
48
|
+
else
|
49
|
+
tk_call_without_enc(self.class::TkCommandNames[0], @path)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
private :create_self
|
53
|
+
|
54
|
+
def __strval_optkeys
|
55
|
+
super() << 'fg' << 'bg' << 'insertbackground'
|
56
|
+
end
|
57
|
+
private :__strval_optkeys
|
58
|
+
|
59
|
+
def complete?
|
60
|
+
bool(tk_send_without_enc('complete'))
|
61
|
+
end
|
62
|
+
|
63
|
+
def insert(*ip)
|
64
|
+
tk_send_without_enc('insert', array2tk_list(ip.flatten))
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#
|
2
|
+
# tkextlib/tcllib/panelframe.rb
|
3
|
+
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
4
|
+
#
|
5
|
+
# * Part of tcllib extension
|
6
|
+
# * Create PanelFrame widgets.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'tk'
|
10
|
+
require 'tkextlib/tcllib.rb'
|
11
|
+
|
12
|
+
# TkPackage.require('widget::panelframe', '1.0')
|
13
|
+
TkPackage.require('widget::panelframe')
|
14
|
+
|
15
|
+
module Tk::Tcllib
|
16
|
+
module Widget
|
17
|
+
class PanelFrame < TkWindow
|
18
|
+
PACKAGE_NAME = 'widget::panelframe'.freeze
|
19
|
+
def self.package_name
|
20
|
+
PACKAGE_NAME
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.package_version
|
24
|
+
begin
|
25
|
+
TkPackage.require('widget::panelframe')
|
26
|
+
rescue
|
27
|
+
''
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
Panelframe = PanelFrame
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class Tk::Tcllib::Widget::PanelFrame
|
36
|
+
TkCommandNames = ['::widget::panelframe'.freeze].freeze
|
37
|
+
|
38
|
+
def create_self(keys)
|
39
|
+
if keys and keys != None
|
40
|
+
tk_call_without_enc(self.class::TkCommandNames[0], @path,
|
41
|
+
*hash_kv(keys, true))
|
42
|
+
else
|
43
|
+
tk_call_without_enc(self.class::TkCommandNames[0], @path)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
private :create_self
|
47
|
+
|
48
|
+
def add(what, *args)
|
49
|
+
window(tk_send('add', *args))
|
50
|
+
end
|
51
|
+
|
52
|
+
#def get_frame
|
53
|
+
# window(tk_send('getframe'))
|
54
|
+
#end
|
55
|
+
|
56
|
+
def set_widget(widget)
|
57
|
+
tk_send('setwidget', widget)
|
58
|
+
self
|
59
|
+
end
|
60
|
+
|
61
|
+
def remove(*wins)
|
62
|
+
tk_send('remove', *wins)
|
63
|
+
end
|
64
|
+
def remove_destroy(*wins)
|
65
|
+
tk_send('remove', '-destroy', *wins)
|
66
|
+
end
|
67
|
+
alias delete remove_destroy
|
68
|
+
|
69
|
+
def items
|
70
|
+
simplelist(tk_send('items')).collect!{|w| window(w)}
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,886 @@
|
|
1
|
+
#
|
2
|
+
# tkextlib/tcllib/plotchart.rb
|
3
|
+
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
4
|
+
#
|
5
|
+
# * Part of tcllib extension
|
6
|
+
# * Simple plotting and charting package
|
7
|
+
#
|
8
|
+
# (The following is the original description of the library.)
|
9
|
+
#
|
10
|
+
# Plotchart is a Tcl-only package that focuses on the easy creation of
|
11
|
+
# xy-plots, barcharts and other common types of graphical presentations.
|
12
|
+
# The emphasis is on ease of use, rather than flexibility. The procedures
|
13
|
+
# that create a plot use the entire canvas window, making the layout of the
|
14
|
+
# plot completely automatic.
|
15
|
+
#
|
16
|
+
# This results in the creation of an xy-plot in, say, ten lines of code:
|
17
|
+
# --------------------------------------------------------------------
|
18
|
+
# package require Plotchart
|
19
|
+
#
|
20
|
+
# canvas .c -background white -width 400 -height 200
|
21
|
+
# pack .c -fill both
|
22
|
+
#
|
23
|
+
# #
|
24
|
+
# # Create the plot with its x- and y-axes
|
25
|
+
# #
|
26
|
+
# set s [::Plotchart::createXYPlot .c {0.0 100.0 10.0} {0.0 100.0 20.0}]
|
27
|
+
#
|
28
|
+
# foreach {x y} {0.0 32.0 10.0 50.0 25.0 60.0 78.0 11.0 } {
|
29
|
+
# $s plot series1 $x $y
|
30
|
+
# }
|
31
|
+
#
|
32
|
+
# $s title "Data series"
|
33
|
+
# --------------------------------------------------------------------
|
34
|
+
#
|
35
|
+
# A drawback of the package might be that it does not do any data management.
|
36
|
+
# So if the canvas that holds the plot is to be resized, the whole plot must
|
37
|
+
# be redrawn. The advantage, though, is that it offers a number of plot and
|
38
|
+
# chart types:
|
39
|
+
#
|
40
|
+
# * XY-plots like the one shown above with any number of data series.
|
41
|
+
# * Stripcharts, a kind of XY-plots where the horizontal axis is adjusted
|
42
|
+
# automatically. The result is a kind of sliding window on the data
|
43
|
+
# series.
|
44
|
+
# * Polar plots, where the coordinates are polar instead of cartesian.
|
45
|
+
# * Isometric plots, where the scale of the coordinates in the two
|
46
|
+
# directions is always the same, i.e. a circle in world coordinates
|
47
|
+
# appears as a circle on the screen.
|
48
|
+
# You can zoom in and out, as well as pan with these plots (Note: this
|
49
|
+
# works best if no axes are drawn, the zooming and panning routines do
|
50
|
+
# not distinguish the axes), using the mouse buttons with the control
|
51
|
+
# key and the arrow keys with the control key.
|
52
|
+
# * Piecharts, with automatic scaling to indicate the proportions.
|
53
|
+
# * Barcharts, with either vertical or horizontal bars, stacked bars or
|
54
|
+
# bars side by side.
|
55
|
+
# * Timecharts, where bars indicate a time period and milestones or other
|
56
|
+
# important moments in time are represented by triangles.
|
57
|
+
# * 3D plots (both for displaying surfaces and 3D bars)
|
58
|
+
#
|
59
|
+
|
60
|
+
require 'tk'
|
61
|
+
require 'tkextlib/tcllib.rb'
|
62
|
+
|
63
|
+
# TkPackage.require('Plotchart', '0.9')
|
64
|
+
# TkPackage.require('Plotchart', '1.1')
|
65
|
+
TkPackage.require('Plotchart')
|
66
|
+
|
67
|
+
module Tk
|
68
|
+
module Tcllib
|
69
|
+
module Plotchart
|
70
|
+
PACKAGE_NAME = 'Plotchart'.freeze
|
71
|
+
def self.package_name
|
72
|
+
PACKAGE_NAME
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.package_version
|
76
|
+
begin
|
77
|
+
TkPackage.require('Plotchart')
|
78
|
+
rescue
|
79
|
+
''
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
module Tk::Tcllib::Plotchart
|
87
|
+
extend TkCore
|
88
|
+
############################
|
89
|
+
def self.view_port(w, *args) # args := pxmin, pymin, pxmax, pymax
|
90
|
+
tk_call_without_enc('::Plotchart::viewPort', w.path, *(args.flatten))
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.world_coordinates(w, *args) # args := xmin, ymin, xmax, ymax
|
94
|
+
tk_call_without_enc('::Plotchart::worldCoordinates',
|
95
|
+
w.path, *(args.flatten))
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.world_3D_coordinates(w, *args)
|
99
|
+
# args := xmin, ymin, zmin, xmax, ymax, zmax
|
100
|
+
tk_call_without_enc('::Plotchart::world3DCoordinates',
|
101
|
+
w.path, *(args.flatten))
|
102
|
+
end
|
103
|
+
|
104
|
+
def self.coords_to_pixel(w, x, y)
|
105
|
+
list(tk_call_without_enc('::Plotchart::coordsToPixel', w.path, x, y))
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.coords_3D_to_pixel(w, x, y, z)
|
109
|
+
list(tk_call_without_enc('::Plotchart::coords3DToPixel', w.path, x, y, z))
|
110
|
+
end
|
111
|
+
|
112
|
+
def self.polar_coordinates(w, radmax)
|
113
|
+
tk_call_without_enc('::Plotchart::polarCoordinates', w.path, radmax)
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.polar_to_pixel(w, rad, phi)
|
117
|
+
list(tk_call_without_enc('::Plotchart::polarToPixel', w.path, rad, phi))
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.pixel_to_coords(w, x, y)
|
121
|
+
list(tk_call_without_enc('::Plotchart::coordsToPixel', w.path, x, y))
|
122
|
+
end
|
123
|
+
|
124
|
+
def self.determine_scale(w, xmax, ymax)
|
125
|
+
tk_call_without_enc('::Plotchart::determineScale', w.path, xmax, ymax)
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.set_zoom_pan(w)
|
129
|
+
tk_call_without_enc('::Plotchart::setZoomPan', w.path)
|
130
|
+
end
|
131
|
+
|
132
|
+
############################
|
133
|
+
module ChartMethod
|
134
|
+
include TkCore
|
135
|
+
|
136
|
+
def title(str)
|
137
|
+
tk_call_without_enc(@chart, 'title', _get_eval_enc_str(str))
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
def save_plot(filename)
|
142
|
+
tk_call_without_enc(@chart, 'saveplot', filename)
|
143
|
+
self
|
144
|
+
end
|
145
|
+
|
146
|
+
def xtext(str)
|
147
|
+
tk_call_without_enc(@chart, 'xtext', _get_eval_enc_str(str))
|
148
|
+
self
|
149
|
+
end
|
150
|
+
|
151
|
+
def ytext(str)
|
152
|
+
tk_call_without_enc(@chart, 'ytext', _get_eval_enc_str(str))
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
def xconfig(key, value=None)
|
157
|
+
if key.kind_of?(Hash)
|
158
|
+
tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true))
|
159
|
+
else
|
160
|
+
tk_call_without_enc(@chart, 'xconfig',
|
161
|
+
"-#{key}", _get_eval_enc_str(value))
|
162
|
+
end
|
163
|
+
self
|
164
|
+
end
|
165
|
+
|
166
|
+
def yconfig(key, value=None)
|
167
|
+
if key.kind_of?(Hash)
|
168
|
+
tk_call_without_enc(@chart, 'yconfig', *hash_kv(key, true))
|
169
|
+
else
|
170
|
+
tk_call_without_enc(@chart, 'yconfig',
|
171
|
+
"-#{key}", _get_eval_enc_str(value))
|
172
|
+
end
|
173
|
+
self
|
174
|
+
end
|
175
|
+
|
176
|
+
############################
|
177
|
+
def view_port(*args) # args := pxmin, pymin, pxmax, pymax
|
178
|
+
tk_call_without_enc('::Plotchart::viewPort', @path, *(args.flatten))
|
179
|
+
self
|
180
|
+
end
|
181
|
+
|
182
|
+
def world_coordinates(*args) # args := xmin, ymin, xmax, ymax
|
183
|
+
tk_call_without_enc('::Plotchart::worldCoordinates',
|
184
|
+
@path, *(args.flatten))
|
185
|
+
self
|
186
|
+
end
|
187
|
+
|
188
|
+
def world_3D_coordinates(*args)
|
189
|
+
# args := xmin, ymin, zmin, xmax, ymax, zmax
|
190
|
+
tk_call_without_enc('::Plotchart::world3DCoordinates',
|
191
|
+
@path, *(args.flatten))
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
def coords_to_pixel(x, y)
|
196
|
+
list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
|
197
|
+
end
|
198
|
+
|
199
|
+
def coords_3D_to_pixel(x, y, z)
|
200
|
+
list(tk_call_without_enc('::Plotchart::coords3DToPixel', @path, x, y, z))
|
201
|
+
end
|
202
|
+
|
203
|
+
def polar_coordinates(radmax)
|
204
|
+
tk_call_without_enc('::Plotchart::polarCoordinates', @path, radmax)
|
205
|
+
self
|
206
|
+
end
|
207
|
+
|
208
|
+
def polar_to_pixel(rad, phi)
|
209
|
+
list(tk_call_without_enc('::Plotchart::polarToPixel', @path, rad, phi))
|
210
|
+
end
|
211
|
+
|
212
|
+
def pixel_to_coords(x, y)
|
213
|
+
list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
|
214
|
+
end
|
215
|
+
|
216
|
+
def determine_scale(xmax, ymax)
|
217
|
+
tk_call_without_enc('::Plotchart::determineScale', @path, xmax, ymax)
|
218
|
+
self
|
219
|
+
end
|
220
|
+
|
221
|
+
def set_zoom_pan()
|
222
|
+
tk_call_without_enc('::Plotchart::setZoomPan', @path)
|
223
|
+
self
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
############################
|
228
|
+
class XYPlot < Tk::Canvas
|
229
|
+
include ChartMethod
|
230
|
+
|
231
|
+
TkCommandNames = [
|
232
|
+
'canvas'.freeze,
|
233
|
+
'::Plotchart::createXYPlot'.freeze
|
234
|
+
].freeze
|
235
|
+
|
236
|
+
def initialize(*args) # args := ([parent,] xaxis, yaxis [, keys])
|
237
|
+
# xaxis := Array of [minimum, maximum, stepsize]
|
238
|
+
# yaxis := Array of [minimum, maximum, stepsize]
|
239
|
+
if args[0].kind_of?(Array)
|
240
|
+
@xaxis = args.shift
|
241
|
+
@yaxis = args.shift
|
242
|
+
|
243
|
+
super(*args) # create canvas widget
|
244
|
+
else
|
245
|
+
parent = args.shift
|
246
|
+
|
247
|
+
@xaxis = args.shift
|
248
|
+
@yaxis = args.shift
|
249
|
+
|
250
|
+
if parent.kind_of?(Tk::Canvas)
|
251
|
+
@path = parent.path
|
252
|
+
else
|
253
|
+
super(parent, *args) # create canvas widget
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
@chart = _create_chart
|
258
|
+
end
|
259
|
+
|
260
|
+
def _create_chart
|
261
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
262
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
263
|
+
array2tk_list(@xaxis), array2tk_list(@yaxis))
|
264
|
+
end
|
265
|
+
private :_create_chart
|
266
|
+
|
267
|
+
def __destroy_hook__
|
268
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
|
269
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
|
270
|
+
}
|
271
|
+
end
|
272
|
+
|
273
|
+
def plot(series, x, y)
|
274
|
+
tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series), x, y)
|
275
|
+
self
|
276
|
+
end
|
277
|
+
|
278
|
+
def contourlines(xcrd, ycrd, vals, clss=None)
|
279
|
+
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
|
280
|
+
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
|
281
|
+
vals = array2tk_list(vals) if vals.kind_of?(Array)
|
282
|
+
clss = array2tk_list(clss) if clss.kind_of?(Array)
|
283
|
+
|
284
|
+
tk_call_without_enc(@chart, 'contourlines', xcrd, ycrd, vals, clss)
|
285
|
+
self
|
286
|
+
end
|
287
|
+
|
288
|
+
def contourfill(xcrd, ycrd, vals, klasses=None)
|
289
|
+
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
|
290
|
+
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
|
291
|
+
vals = array2tk_list(vals) if vals.kind_of?(Array)
|
292
|
+
clss = array2tk_list(clss) if clss.kind_of?(Array)
|
293
|
+
|
294
|
+
tk_call_without_enc(@chart, 'contourfill', xcrd, ycrd, vals, clss)
|
295
|
+
self
|
296
|
+
end
|
297
|
+
|
298
|
+
def contourbox(xcrd, ycrd, vals, klasses=None)
|
299
|
+
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
|
300
|
+
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
|
301
|
+
vals = array2tk_list(vals) if vals.kind_of?(Array)
|
302
|
+
clss = array2tk_list(clss) if clss.kind_of?(Array)
|
303
|
+
|
304
|
+
tk_call_without_enc(@chart, 'contourbox', xcrd, ycrd, vals, clss)
|
305
|
+
self
|
306
|
+
end
|
307
|
+
|
308
|
+
def color_map(colors)
|
309
|
+
colors = array2tk_list(colors) if colors.kind_of?(Array)
|
310
|
+
|
311
|
+
tk_call_without_enc(@chart, 'colorMap', colors)
|
312
|
+
self
|
313
|
+
end
|
314
|
+
|
315
|
+
def grid_cells(xcrd, ycrd)
|
316
|
+
xcrd = array2tk_list(xcrd) if xcrd.kind_of?(Array)
|
317
|
+
ycrd = array2tk_list(ycrd) if ycrd.kind_of?(Array)
|
318
|
+
|
319
|
+
tk_call_without_enc(@chart, 'grid', xcrd, ycrd)
|
320
|
+
self
|
321
|
+
end
|
322
|
+
|
323
|
+
def dataconfig(series, key, value=None)
|
324
|
+
if key.kind_of?(Hash)
|
325
|
+
tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
|
326
|
+
else
|
327
|
+
tk_call_without_enc(@chart, 'dataconfig', series,
|
328
|
+
"-#{key}", _get_eval_enc_str(value))
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
############################
|
334
|
+
class Stripchart < XYPlot
|
335
|
+
TkCommandNames = [
|
336
|
+
'canvas'.freeze,
|
337
|
+
'::Plotchart::createStripchart'.freeze
|
338
|
+
].freeze
|
339
|
+
end
|
340
|
+
|
341
|
+
############################
|
342
|
+
class PolarPlot < Tk::Canvas
|
343
|
+
include ChartMethod
|
344
|
+
|
345
|
+
TkCommandNames = [
|
346
|
+
'canvas'.freeze,
|
347
|
+
'::Plotchart::createPolarplot'.freeze
|
348
|
+
].freeze
|
349
|
+
|
350
|
+
def initialize(*args) # args := ([parent,] radius_data [, keys])
|
351
|
+
# radius_data := Array of [maximum_radius, stepsize]
|
352
|
+
if args[0].kind_of?(Array)
|
353
|
+
@radius_data = args.shift
|
354
|
+
|
355
|
+
super(*args) # create canvas widget
|
356
|
+
else
|
357
|
+
parent = args.shift
|
358
|
+
|
359
|
+
@radius_data = args.shift
|
360
|
+
|
361
|
+
if parent.kind_of?(Tk::Canvas)
|
362
|
+
@path = parent.path
|
363
|
+
else
|
364
|
+
super(parent, *args) # create canvas widget
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
@chart = _create_chart
|
369
|
+
end
|
370
|
+
|
371
|
+
def _create_chart
|
372
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
373
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
374
|
+
array2tk_list(@radius_data))
|
375
|
+
end
|
376
|
+
private :_create_chart
|
377
|
+
|
378
|
+
def __destroy_hook__
|
379
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
|
380
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
|
381
|
+
}
|
382
|
+
end
|
383
|
+
|
384
|
+
def plot(series, radius, angle)
|
385
|
+
tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(series),
|
386
|
+
radius, angle)
|
387
|
+
self
|
388
|
+
end
|
389
|
+
|
390
|
+
def dataconfig(series, key, value=None)
|
391
|
+
if key.kind_of?(Hash)
|
392
|
+
tk_call_without_enc(@chart, 'dataconfig', series, *hash_kv(key, true))
|
393
|
+
else
|
394
|
+
tk_call_without_enc(@chart, 'dataconfig', series,
|
395
|
+
"-#{key}", _get_eval_enc_str(value))
|
396
|
+
end
|
397
|
+
end
|
398
|
+
end
|
399
|
+
Polarplot = PolarPlot
|
400
|
+
|
401
|
+
############################
|
402
|
+
class IsometricPlot < Tk::Canvas
|
403
|
+
include ChartMethod
|
404
|
+
|
405
|
+
TkCommandNames = [
|
406
|
+
'canvas'.freeze,
|
407
|
+
'::Plotchart::createIsometricPlot'.freeze
|
408
|
+
].freeze
|
409
|
+
|
410
|
+
def initialize(*args) # args := ([parent,] xaxis, yaxis, [, step] [, keys])
|
411
|
+
# xaxis := Array of [minimum, maximum]
|
412
|
+
# yaxis := Array of [minimum, maximum]
|
413
|
+
# step := Float of stepsize | "noaxes" | :noaxes
|
414
|
+
if args[0].kind_of?(Array)
|
415
|
+
@xaxis = args.shift
|
416
|
+
@yaxis = args.shift
|
417
|
+
|
418
|
+
if args[0].kind_of?(Hash)
|
419
|
+
@stepsize = :noaxes
|
420
|
+
else
|
421
|
+
@stepsize = args.shift
|
422
|
+
end
|
423
|
+
|
424
|
+
super(*args) # create canvas widget
|
425
|
+
else
|
426
|
+
parent = args.shift
|
427
|
+
|
428
|
+
@xaxis = args.shift
|
429
|
+
@yaxis = args.shift
|
430
|
+
|
431
|
+
if args[0].kind_of?(Hash)
|
432
|
+
@stepsize = :noaxes
|
433
|
+
else
|
434
|
+
@stepsize = args.shift
|
435
|
+
end
|
436
|
+
|
437
|
+
if parent.kind_of?(Tk::Canvas)
|
438
|
+
@path = parent.path
|
439
|
+
else
|
440
|
+
super(parent, *args) # create canvas widget
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
@chart = _create_chart
|
445
|
+
end
|
446
|
+
|
447
|
+
def _create_chart
|
448
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
449
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
450
|
+
array2tk_list(@xaxis), array2tk_list(@yaxis),
|
451
|
+
@stepsize)
|
452
|
+
end
|
453
|
+
private :_create_chart
|
454
|
+
|
455
|
+
def plot(type, *args)
|
456
|
+
self.__send__("plot_#{type.to_s.tr('-', '_')}", *args)
|
457
|
+
end
|
458
|
+
|
459
|
+
def plot_rectangle(*args) # args := x1, y1, x2, y2, color
|
460
|
+
tk_call_without_enc(@chart, 'plot', 'rectangle', *(args.flatten))
|
461
|
+
self
|
462
|
+
end
|
463
|
+
|
464
|
+
def plot_filled_rectangle(*args) # args := x1, y1, x2, y2, color
|
465
|
+
tk_call_without_enc(@chart, 'plot', 'filled-rectangle', *(args.flatten))
|
466
|
+
self
|
467
|
+
end
|
468
|
+
|
469
|
+
def plot_circle(*args) # args := xc, yc, radius, color
|
470
|
+
tk_call_without_enc(@chart, 'plot', 'circle', *(args.flatten))
|
471
|
+
self
|
472
|
+
end
|
473
|
+
|
474
|
+
def plot_filled_circle(*args) # args := xc, yc, radius, color
|
475
|
+
tk_call_without_enc(@chart, 'plot', 'filled-circle', *(args.flatten))
|
476
|
+
self
|
477
|
+
end
|
478
|
+
end
|
479
|
+
Isometricplot = IsometricPlot
|
480
|
+
|
481
|
+
############################
|
482
|
+
class Plot3D < Tk::Canvas
|
483
|
+
include ChartMethod
|
484
|
+
|
485
|
+
TkCommandNames = [
|
486
|
+
'canvas'.freeze,
|
487
|
+
'::Plotchart::create3DPlot'.freeze
|
488
|
+
].freeze
|
489
|
+
|
490
|
+
def initialize(*args) # args := ([parent,] xaxis, yaxis, zaxis [, keys])
|
491
|
+
# xaxis := Array of [minimum, maximum, stepsize]
|
492
|
+
# yaxis := Array of [minimum, maximum, stepsize]
|
493
|
+
# zaxis := Array of [minimum, maximum, stepsize]
|
494
|
+
if args[0].kind_of?(Array)
|
495
|
+
@xaxis = args.shift
|
496
|
+
@yaxis = args.shift
|
497
|
+
@zaxis = args.shift
|
498
|
+
|
499
|
+
super(*args) # create canvas widget
|
500
|
+
else
|
501
|
+
parent = args.shift
|
502
|
+
|
503
|
+
@xaxis = args.shift
|
504
|
+
@yaxis = args.shift
|
505
|
+
@zaxis = args.shift
|
506
|
+
|
507
|
+
if parent.kind_of?(Tk::Canvas)
|
508
|
+
@path = parent.path
|
509
|
+
else
|
510
|
+
super(parent, *args) # create canvas widget
|
511
|
+
end
|
512
|
+
end
|
513
|
+
|
514
|
+
@chart = _create_chart
|
515
|
+
end
|
516
|
+
|
517
|
+
def _create_chart
|
518
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
519
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
520
|
+
array2tk_list(@xaxis),
|
521
|
+
array2tk_list(@yaxis),
|
522
|
+
array2tk_list(@zaxis))
|
523
|
+
end
|
524
|
+
private :_create_chart
|
525
|
+
|
526
|
+
def plot_function(cmd=Proc.new)
|
527
|
+
Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
|
528
|
+
tk_call_without_enc(@chart, 'plotfunc', "#{@path}_#{@chart}")
|
529
|
+
self
|
530
|
+
end
|
531
|
+
|
532
|
+
def plot_funcont(conts, cmd=Proc.new)
|
533
|
+
conts = array2tk_list(conts) if conts.kind_of?(Array)
|
534
|
+
Tk.ip_eval("proc #{@path}_#{@chart} {x y} {#{install_cmd(cmd)} $x $y}")
|
535
|
+
tk_call_without_enc(@chart, 'plotfuncont', "#{@path}_#{@chart}", conts)
|
536
|
+
self
|
537
|
+
end
|
538
|
+
|
539
|
+
def grid_size(nxcells, nycells)
|
540
|
+
tk_call_without_enc(@chart, 'gridsize', nxcells, nycells)
|
541
|
+
self
|
542
|
+
end
|
543
|
+
|
544
|
+
def plot_data(dat)
|
545
|
+
# dat has to be provided as a 2 level array.
|
546
|
+
# 1st level contains rows, drawn in y-direction,
|
547
|
+
# and each row is an array whose elements are drawn in x-direction,
|
548
|
+
# for the columns.
|
549
|
+
tk_call_without_enc(@chart, 'plotdata', dat)
|
550
|
+
self
|
551
|
+
end
|
552
|
+
|
553
|
+
def colour(fill, border)
|
554
|
+
# configure the colours to use for polygon borders and inner area
|
555
|
+
tk_call_without_enc(@chart, 'colour', fill, border)
|
556
|
+
self
|
557
|
+
end
|
558
|
+
alias colours colour
|
559
|
+
alias colors colour
|
560
|
+
alias color colour
|
561
|
+
end
|
562
|
+
|
563
|
+
############################
|
564
|
+
class Piechart < Tk::Canvas
|
565
|
+
include ChartMethod
|
566
|
+
|
567
|
+
TkCommandNames = [
|
568
|
+
'canvas'.freeze,
|
569
|
+
'::Plotchart::createPiechart'.freeze
|
570
|
+
].freeze
|
571
|
+
|
572
|
+
def initialize(*args) # args := ([parent] [, keys])
|
573
|
+
if args[0].kind_of?(Tk::Canvas)
|
574
|
+
parent = args.shift
|
575
|
+
@path = parent.path
|
576
|
+
else
|
577
|
+
super(*args) # create canvas widget
|
578
|
+
end
|
579
|
+
@chart = _create_chart
|
580
|
+
end
|
581
|
+
|
582
|
+
def _create_chart
|
583
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
584
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path)
|
585
|
+
end
|
586
|
+
private :_create_chart
|
587
|
+
|
588
|
+
def plot(*dat) # argument is a list of [label, value]
|
589
|
+
tk_call_without_enc(@chart, 'plot', dat.flatten)
|
590
|
+
self
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
############################
|
595
|
+
class Barchart < Tk::Canvas
|
596
|
+
include ChartMethod
|
597
|
+
|
598
|
+
TkCommandNames = [
|
599
|
+
'canvas'.freeze,
|
600
|
+
'::Plotchart::createBarchart'.freeze
|
601
|
+
].freeze
|
602
|
+
|
603
|
+
def initialize(*args)
|
604
|
+
# args := ([parent,] xlabels, ylabels [, series] [, keys])
|
605
|
+
# xlabels, ylabels := labels | axis ( depend on normal or horizontal )
|
606
|
+
# labels := Array of [label, label, ...]
|
607
|
+
# (It determines the number of bars that will be plotted per series.)
|
608
|
+
# axis := Array of [minimum, maximum, stepsize]
|
609
|
+
# series := Integer number of data series | 'stacked' | :stacked
|
610
|
+
if args[0].kind_of?(Array)
|
611
|
+
@xlabels = args.shift
|
612
|
+
@ylabels = args.shift
|
613
|
+
|
614
|
+
if args[0].kind_of?(Hash)
|
615
|
+
@series_size = :stacked
|
616
|
+
else
|
617
|
+
@series_size = args.shift
|
618
|
+
end
|
619
|
+
|
620
|
+
super(*args) # create canvas widget
|
621
|
+
else
|
622
|
+
parent = args.shift
|
623
|
+
|
624
|
+
@xlabels = args.shift
|
625
|
+
@ylabels = args.shift
|
626
|
+
|
627
|
+
if args[0].kind_of?(Hash)
|
628
|
+
@series_size = :stacked
|
629
|
+
else
|
630
|
+
@series_size = args.shift
|
631
|
+
end
|
632
|
+
|
633
|
+
if parent.kind_of?(Tk::Canvas)
|
634
|
+
@path = parent.path
|
635
|
+
else
|
636
|
+
super(parent, *args) # create canvas widget
|
637
|
+
end
|
638
|
+
end
|
639
|
+
|
640
|
+
@chart = _create_chart
|
641
|
+
end
|
642
|
+
|
643
|
+
def _create_chart
|
644
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
645
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
646
|
+
array2tk_list(@xlabels), array2tk_list(@ylabels),
|
647
|
+
@series_size)
|
648
|
+
end
|
649
|
+
private :_create_chart
|
650
|
+
|
651
|
+
def __destroy_hook__
|
652
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.mutex.synchronize{
|
653
|
+
Tk::Tcllib::Plotchart::PlotSeries::SeriesID_TBL.delete(@path)
|
654
|
+
}
|
655
|
+
end
|
656
|
+
|
657
|
+
def plot(series, dat, col=None)
|
658
|
+
tk_call_without_enc(@chart, 'plot', series, dat, col)
|
659
|
+
self
|
660
|
+
end
|
661
|
+
|
662
|
+
def colours(*cols)
|
663
|
+
# set the colours to be used
|
664
|
+
tk_call_without_enc(@chart, 'colours', *cols)
|
665
|
+
self
|
666
|
+
end
|
667
|
+
alias colour colours
|
668
|
+
alias colors colours
|
669
|
+
alias color colours
|
670
|
+
end
|
671
|
+
|
672
|
+
############################
|
673
|
+
class HorizontalBarchart < Barchart
|
674
|
+
TkCommandNames = [
|
675
|
+
'canvas'.freeze,
|
676
|
+
'::Plotchart::createHorizontalBarchart'.freeze
|
677
|
+
].freeze
|
678
|
+
end
|
679
|
+
|
680
|
+
############################
|
681
|
+
class Timechart < Tk::Canvas
|
682
|
+
include ChartMethod
|
683
|
+
|
684
|
+
TkCommandNames = [
|
685
|
+
'canvas'.freeze,
|
686
|
+
'::Plotchart::createTimechart'.freeze
|
687
|
+
].freeze
|
688
|
+
|
689
|
+
def initialize(*args)
|
690
|
+
# args := ([parent,] time_begin, time_end, items [, keys])
|
691
|
+
# time_begin := String of time format (e.g. "1 january 2004")
|
692
|
+
# time_end := String of time format (e.g. "1 january 2004")
|
693
|
+
# items := Expected/maximum number of items
|
694
|
+
# ( This determines the vertical spacing. )
|
695
|
+
if args[0].kind_of?(String)
|
696
|
+
@time_begin = args.shift
|
697
|
+
@time_end = args.shift
|
698
|
+
@items = args.shift
|
699
|
+
|
700
|
+
super(*args) # create canvas widget
|
701
|
+
else
|
702
|
+
parent = args.shift
|
703
|
+
|
704
|
+
@time_begin = args.shift
|
705
|
+
@time_end = args.shift
|
706
|
+
@items = args.shift
|
707
|
+
|
708
|
+
if parent.kind_of?(Tk::Canvas)
|
709
|
+
@path = parent.path
|
710
|
+
else
|
711
|
+
super(parent, *args) # create canvas widget
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
715
|
+
@chart = _create_chart
|
716
|
+
end
|
717
|
+
|
718
|
+
def _create_chart
|
719
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
720
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
721
|
+
@time_begin, @time_end, @items)
|
722
|
+
end
|
723
|
+
private :_create_chart
|
724
|
+
|
725
|
+
def period(txt, time_begin, time_end, col=None)
|
726
|
+
tk_call_without_enc(@chart, 'period', txt, time_begin, time_end, col)
|
727
|
+
self
|
728
|
+
end
|
729
|
+
|
730
|
+
def milestone(txt, time, col=None)
|
731
|
+
tk_call_without_enc(@chart, 'milestone', txt, time, col)
|
732
|
+
self
|
733
|
+
end
|
734
|
+
|
735
|
+
def vertline(txt, time)
|
736
|
+
tk_call_without_enc(@chart, 'vertline', txt, time)
|
737
|
+
self
|
738
|
+
end
|
739
|
+
end
|
740
|
+
|
741
|
+
############################
|
742
|
+
class Gnattchart < Tk::Canvas
|
743
|
+
include ChartMethod
|
744
|
+
|
745
|
+
TkCommandNames = [
|
746
|
+
'canvas'.freeze,
|
747
|
+
'::Plotchart::createGnattchart'.freeze
|
748
|
+
].freeze
|
749
|
+
|
750
|
+
def initialize(*args)
|
751
|
+
# args := ([parent,] time_begin, time_end, items [, text_width] [, keys])
|
752
|
+
# time_begin := String of time format (e.g. "1 january 2004")
|
753
|
+
# time_end := String of time format (e.g. "1 january 2004")
|
754
|
+
# items := Expected/maximum number of items
|
755
|
+
# ( This determines the vertical spacing. )
|
756
|
+
if args[0].kind_of?(String)
|
757
|
+
@time_begin = args.shift
|
758
|
+
@time_end = args.shift
|
759
|
+
@items = args.shift
|
760
|
+
|
761
|
+
if args[0].kind_of?(Fixnum)
|
762
|
+
@text_width = args.shift
|
763
|
+
else
|
764
|
+
@text_width = None
|
765
|
+
end
|
766
|
+
|
767
|
+
super(*args) # create canvas widget
|
768
|
+
else
|
769
|
+
parent = args.shift
|
770
|
+
|
771
|
+
@time_begin = args.shift
|
772
|
+
@time_end = args.shift
|
773
|
+
@items = args.shift
|
774
|
+
|
775
|
+
if args[0].kind_of?(Fixnum)
|
776
|
+
@text_width = args.shift
|
777
|
+
else
|
778
|
+
@text_width = None
|
779
|
+
end
|
780
|
+
|
781
|
+
if parent.kind_of?(Tk::Canvas)
|
782
|
+
@path = parent.path
|
783
|
+
else
|
784
|
+
super(parent, *args) # create canvas widget
|
785
|
+
end
|
786
|
+
end
|
787
|
+
|
788
|
+
@chart = _create_chart
|
789
|
+
end
|
790
|
+
|
791
|
+
def _create_chart
|
792
|
+
p self.class::TkCommandNames[1] if $DEBUG
|
793
|
+
tk_call_without_enc(self.class::TkCommandNames[1], @path,
|
794
|
+
@time_begin, @time_end, @items, @text_width)
|
795
|
+
end
|
796
|
+
private :_create_chart
|
797
|
+
|
798
|
+
def task(txt, time_begin, time_end, completed=0.0)
|
799
|
+
list(tk_call_without_enc(@chart, 'task', txt, time_begin, time_end,
|
800
|
+
completed)).collect!{|id|
|
801
|
+
TkcItem.id2obj(self, id)
|
802
|
+
}
|
803
|
+
end
|
804
|
+
|
805
|
+
def milestone(txt, time, col=None)
|
806
|
+
tk_call_without_enc(@chart, 'milestone', txt, time, col)
|
807
|
+
self
|
808
|
+
end
|
809
|
+
|
810
|
+
def vertline(txt, time)
|
811
|
+
tk_call_without_enc(@chart, 'vertline', txt, time)
|
812
|
+
self
|
813
|
+
end
|
814
|
+
|
815
|
+
def connect(from_task, to_task)
|
816
|
+
from_task = array2tk_list(from_task) if from_task.kind_of?(Array)
|
817
|
+
to_task = array2tk_list(to_task) if to_task.kind_of?(Array)
|
818
|
+
|
819
|
+
tk_call_without_enc(@chart, 'connect', from_task, to_task)
|
820
|
+
self
|
821
|
+
end
|
822
|
+
|
823
|
+
def summary(txt, tasks)
|
824
|
+
tasks = array2tk_list(tasks) if tasks.kind_of?(Array)
|
825
|
+
tk_call_without_enc(@chart, 'summary', tasks)
|
826
|
+
self
|
827
|
+
end
|
828
|
+
|
829
|
+
def color_of_part(keyword, newcolor)
|
830
|
+
tk_call_without_enc(@chart, 'color', keyword, newcolor)
|
831
|
+
self
|
832
|
+
end
|
833
|
+
|
834
|
+
def font_of_part(keyword, newfont)
|
835
|
+
tk_call_without_enc(@chart, 'font', keyword, newfont)
|
836
|
+
self
|
837
|
+
end
|
838
|
+
end
|
839
|
+
|
840
|
+
############################
|
841
|
+
class PlotSeries < TkObject
|
842
|
+
SeriesID_TBL = TkCore::INTERP.create_table
|
843
|
+
|
844
|
+
(Series_ID = ['series'.freeze, '00000'.taint]).instance_eval{
|
845
|
+
@mutex = Mutex.new
|
846
|
+
def mutex; @mutex; end
|
847
|
+
freeze
|
848
|
+
}
|
849
|
+
TkCore::INTERP.init_ip_env{
|
850
|
+
SeriesID_TBL.mutex.synchronize{ SeriesID_TBL.clear }
|
851
|
+
}
|
852
|
+
|
853
|
+
def self.id2obj(chart, id)
|
854
|
+
path = chart.path
|
855
|
+
SeriesID_TBL.mutex.synchronize{
|
856
|
+
if SeriesID_TBL[path]
|
857
|
+
SeriesID_TBL[path][id]? SeriesID_TBL[path][id]: id
|
858
|
+
else
|
859
|
+
id
|
860
|
+
end
|
861
|
+
}
|
862
|
+
end
|
863
|
+
|
864
|
+
def initialize(chart, keys=nil)
|
865
|
+
@parent = @chart_obj = chart
|
866
|
+
@ppath = @chart_obj.path
|
867
|
+
Series_ID.mutex.synchronize{
|
868
|
+
@path = @series = @id = Series_ID.join(TkCore::INTERP._ip_id_)
|
869
|
+
Series_ID[1].succ!
|
870
|
+
}
|
871
|
+
SeriesID_TBL.mutex.synchronize{
|
872
|
+
SeriesID_TBL[@ppath] ||= {}
|
873
|
+
SeriesID_TBL[@ppath][@id] = self
|
874
|
+
}
|
875
|
+
dataconfig(keys) if keys.kind_of?(Hash)
|
876
|
+
end
|
877
|
+
|
878
|
+
def plot(*args)
|
879
|
+
@chart_obj.plot(@series, *args)
|
880
|
+
end
|
881
|
+
|
882
|
+
def dataconfig(key, value=None)
|
883
|
+
@chart_obj.dataconfig(@series, key, value)
|
884
|
+
end
|
885
|
+
end
|
886
|
+
end
|