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
data/ext/README.1st
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
If you want to use Ruby/Tk (tk.rb and so on), you must have tcltklib.so
|
2
|
+
which is working correctly. When you have some troubles on compiling,
|
3
|
+
please read README.tcltklib and README.ActiveTcl.
|
4
|
+
Even if there is a tcltklib.so on your Ruby library directry, it will not
|
5
|
+
work without Tcl/Tk libraries (e.g. libtcl8.4.so) on your environment.
|
6
|
+
You must also check that your Tcl/Tk is installed properly.
|
7
|
+
|
8
|
+
--------------------------------------------
|
9
|
+
( the following is written in EUC-JP )
|
10
|
+
|
11
|
+
Ruby/Tk (tk.rb �ʤ�) ��Ȥ��������ˤϡ�tcltklib.so ��������ư���Ƥ���
|
12
|
+
����Фʤ�ޤ�����ѥ�����˲������꤬���������ϡ�README.tcltklib
|
13
|
+
�� README.ActiveTcl �Ƥ���������
|
14
|
+
���Ȥ� Ruby �Υ饤�֥��ǥ��쥯�ȥ�� tcltklib.so ��¸�ߤ��Ƥ����Ȥ���
|
15
|
+
�⡤�¹ԴĶ��� Tcl/Tk �饤�֥�� (libtcl8.4.so �ʤ�) ���ʤ���е�ǽ����
|
16
|
+
����Tcl/Tk �����������ȡ��뤵��Ƥ��뤫������å����Ƥ���������
|
17
|
+
|
18
|
+
==========================================================
|
19
|
+
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
ActiveTcl is ActiveState's quality-assured distribution of Tcl.
|
2
|
+
|
3
|
+
# see <http://www.activestate.com/Products/ActiveTcl/>
|
4
|
+
# <http://www.tcl.tk/>
|
5
|
+
|
6
|
+
If you want to use ActiveTcl binary package as the Tcl/Tk libraries,
|
7
|
+
please use the following configure options.
|
8
|
+
|
9
|
+
--with-tcl-dir=<ActiveTcl_root>
|
10
|
+
--with-tk-dir=<ActiveTcl_root>
|
11
|
+
|
12
|
+
And use the followings if you need.
|
13
|
+
|
14
|
+
--with-tcllib=<libname>
|
15
|
+
--with-tklib=<libname>
|
16
|
+
--enable-tcltk-stubs
|
17
|
+
|
18
|
+
For example, when you install ActiveTcl-8.4.x to '/usr/local/ActiveTcl',
|
19
|
+
|
20
|
+
configure --with-tcl-dir=/usr/local/ActiveTcl/ \
|
21
|
+
--with-tk-dir=/usr/local/ActiveTcl/ \
|
22
|
+
--with-tcllib=tclstub8.4 \
|
23
|
+
--with-tklib=tkstub8.4 \
|
24
|
+
--enable-tcltk-stubs
|
25
|
+
|
26
|
+
It depends on your environment that you have to add the directory of
|
27
|
+
ActiveTcl's libraries to your library path when execute Ruby/Tk.
|
28
|
+
One of the way is to add entries to TCLLIBPATH environment variable,
|
29
|
+
and one of the others add to LD_LIBRARY_PATH environment variable
|
30
|
+
|
31
|
+
Probably, using TCLLIBPATH is better. The value is appended at the
|
32
|
+
head of Tcl's 'auto_path' variable. You can see the value of the
|
33
|
+
variable by using 'Tk::AUTO_PATH.value' or 'Tk::AUTO_PATH.list'.
|
34
|
+
|
35
|
+
For example, on Linux, one of the ways is to use LD_LIBRARY_PATH
|
36
|
+
environment variable.
|
37
|
+
-------------------------------------------------------------------------
|
38
|
+
[bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH \
|
39
|
+
ruby your-Ruby/Tk-script
|
40
|
+
|
41
|
+
[bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH irb
|
42
|
+
-------------------------------------------------------------------------
|
43
|
+
Based on it, the Tcl interpreter changes auto_path variable's value.
|
44
|
+
|
45
|
+
Then, you'll be able to use Tcl/Tk extension libraries included in the
|
46
|
+
ActiveTcl package (e.g. call TkPackage.require('BWidget'), and then,
|
47
|
+
use functions/widgets of BWidget extention).
|
48
|
+
|
49
|
+
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
data/ext/README.fork
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
Ruby/Tk does NOT support forking the process on which Tk interpreter
|
2
|
+
is running (unless NEVER control Tk interpreter under the forked child
|
3
|
+
process). In the library 'tk.rb', a Tk interpreter is initialized.
|
4
|
+
Therefore, if you want running Tk under a child process, please call
|
5
|
+
"require 'tk'" in the child process.
|
6
|
+
|
7
|
+
# If do fork and exec(<new Ruby/Tk>) on the child process, you can
|
8
|
+
# control Ruby/Tk interpreter on the child process by 'send' command
|
9
|
+
# of Tcl/Tk. About this, please see Tk.appsend and Tk.rb_appsend, or
|
10
|
+
# 'remote-tk.rb' and the sample 'sample/remote-ip_sample.rb'.
|
11
|
+
|
12
|
+
For example, the following sample1 will NOT work, and sample2 will
|
13
|
+
work properly.
|
14
|
+
|
15
|
+
---<sample1: NOT work>---------------------------------------
|
16
|
+
require 'tk' ## init Tk interpreter under parent process
|
17
|
+
|
18
|
+
exit! if fork ## exit parent process
|
19
|
+
|
20
|
+
## child process
|
21
|
+
TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
|
22
|
+
Tk.mainloop
|
23
|
+
-------------------------------------------------------------
|
24
|
+
|
25
|
+
---<sample2: will work>--------------------------------------
|
26
|
+
exit! if fork ## exit main process
|
27
|
+
|
28
|
+
## child process
|
29
|
+
require 'tk' ## init Tk interpreter under child process
|
30
|
+
TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
|
31
|
+
Tk.mainloop
|
32
|
+
-------------------------------------------------------------
|
33
|
+
|
34
|
+
2004/05/22 Hidetoshi NAGAI
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
*** for MacOS X Aqua (Tcl/Tk Aqua) users ***
|
3
|
+
|
4
|
+
First of all, please read README.tcltklib to use Tcl/Tk Aqua Framework.
|
5
|
+
|
6
|
+
With Tcl/Tk Aqua libraries, current tcltklib somtimes freezes when
|
7
|
+
using Aqua specific dialogs (e.g. Tk.messageBox).
|
8
|
+
This is a known bug of Ruby-1.8.4 release.
|
9
|
+
|
10
|
+
When you meet the trouble on your GUI, you'll be able to avoid the trouble
|
11
|
+
by Tcl/Tk's traditional dialogs.
|
12
|
+
If you want to do that, please call some of the following bits of script
|
13
|
+
after "reqruie 'tk'".
|
14
|
+
|
15
|
+
=================================================================
|
16
|
+
# use a traditional dialog for Tk.chooseColor()
|
17
|
+
Tk.ip_eval(<<'EOS')
|
18
|
+
proc ::tk_chooseColor {args} {
|
19
|
+
return [eval tk::dialog::color:: $args]
|
20
|
+
}
|
21
|
+
EOS
|
22
|
+
|
23
|
+
# use a traditional dialog for Tk.getOpenFile() and Tk.getMultipleOpenFile()
|
24
|
+
Tk.ip_eval(<<'EOS')
|
25
|
+
proc ::tk_getOpenFile {args} {
|
26
|
+
if {$::tk_strictMotif} {
|
27
|
+
return [eval tk::MotifFDialog open $args]
|
28
|
+
} else {
|
29
|
+
return [eval ::tk::dialog::file:: open $args]
|
30
|
+
}
|
31
|
+
}
|
32
|
+
EOS
|
33
|
+
|
34
|
+
# use a traditional dialog for Tk.getSaveFile() and Tk.getMultipleSaveFile()
|
35
|
+
Tk.ip_eval(<<'EOS')
|
36
|
+
proc ::tk_getSaveFile {args} {
|
37
|
+
if {$::tk_strictMotif} {
|
38
|
+
return [eval tk::MotifFDialog save $args]
|
39
|
+
} else {
|
40
|
+
return [eval ::tk::dialog::file:: save $args]
|
41
|
+
}
|
42
|
+
}
|
43
|
+
EOS
|
44
|
+
|
45
|
+
# use a traditional dialog for Tk.messageBox()
|
46
|
+
Tk.ip_eval(<<'EOS')
|
47
|
+
proc ::tk_messageBox {args} {
|
48
|
+
return [eval tk::MessageBox $args]
|
49
|
+
}
|
50
|
+
EOS
|
51
|
+
|
52
|
+
# use a traditional dialog for Tk.chooseDirectory()
|
53
|
+
Tk.ip_eval(<<'EOS')
|
54
|
+
proc ::tk_chooseDirectory {args} {
|
55
|
+
return [eval ::tk::dialog::file::chooseDir:: $args]
|
56
|
+
}
|
57
|
+
EOS
|
58
|
+
=================================================================
|
59
|
+
|
60
|
+
Each of them replaces the platform specific dialog command to the
|
61
|
+
traditional one.
|
62
|
+
|
63
|
+
If you use some MultiTkIp objects, probably, you'll have to call the
|
64
|
+
bits of script for each MultiTkIp object.
|
65
|
+
|
66
|
+
--
|
67
|
+
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
data/ext/README.tcltklib
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
To compile 'tcltklib', you must have Tcl/Tk libraries on your environment.
|
2
|
+
Although 'extconf.rb' script searches Tcl/Tk libraries and header files,
|
3
|
+
sometimes fails to find them. And then, 'tcltklib' cannot be compiled. If
|
4
|
+
Tcl/Tk libraries or header files are installed but are not found, you can
|
5
|
+
give the information by arguments of the 'configure' script. Please give
|
6
|
+
some or all of the following options.
|
7
|
+
|
8
|
+
--with-tcltkversion=<version>
|
9
|
+
force version of Tcl/Tk libaray
|
10
|
+
(e.g. libtcl8.4g.so ==> --with-tcltkversion=8.4g)
|
11
|
+
|
12
|
+
--with-tcllib=<libname> (e.g. libtcl8.4.so ==> --with-tcllib=tcl8.4)
|
13
|
+
--with-tklib=<libname> (e.g. libtk8.4.so ==> --with-tklib=tk8.4)
|
14
|
+
|
15
|
+
--enable-tcltk-stubs (if you force to enable stubs)
|
16
|
+
|
17
|
+
--with-tcl-dir=<path>
|
18
|
+
equal to "--with-tcl-include=<path>/include --with-tcl-lib=<path>/lib"
|
19
|
+
|
20
|
+
--with-tk-dir=<path>
|
21
|
+
equal to "--with-tk-include=<path>/include --with-tk-lib=<path>/lib"
|
22
|
+
|
23
|
+
--with-tcl-include=<dir> the directry contains 'tcl.h'
|
24
|
+
--with-tk-include=<dir> the directry contains 'tk.h'
|
25
|
+
|
26
|
+
--with-tcl-lib=<dir> the directry contains 'libtcl<version>.so'
|
27
|
+
--with-tk-lib=<dir> the directry contains 'libtk<version>.so'
|
28
|
+
|
29
|
+
--enable-mac-tcltk-framework (MacOS X) use Tcl/Tk framework
|
30
|
+
(Obsolete. Please use '--enable-tcltk-framework'.)
|
31
|
+
|
32
|
+
--enable-tcltk-framework use Tcl/Tk framework
|
33
|
+
|
34
|
+
--with-tcltk-framework=<dir> the directory contains Tcl/Tk framework;
|
35
|
+
"<dir>/Tcl.framework" and "<dir>/Tk.framework".
|
36
|
+
When this option is given, it is assumed that
|
37
|
+
--enable-tcltk-framework option is given also.
|
38
|
+
|
39
|
+
--with-tcl-framework-header=<dir>
|
40
|
+
Tcl framework headers directory
|
41
|
+
(e.g. "/Library/Frameworks/Tcl.framework/Headers")
|
42
|
+
|
43
|
+
--with-tk-framework-header=<dir>
|
44
|
+
Tk framework headers directory
|
45
|
+
(e.g. "/Library/Frameworks/Tk.framework/Headers")
|
46
|
+
|
47
|
+
|
48
|
+
--with-X11 / --without-X11 use / not use the X Window System
|
49
|
+
|
50
|
+
--with-X11-dir=<path>
|
51
|
+
equal to "--with-X11-include=<path>/include --with-X11-lib=<path>/lib"
|
52
|
+
|
53
|
+
--with-X11-include=<dir> the directry contais X11 header files
|
54
|
+
--with-X11-lib=<dir> the directry contais X11 libraries
|
55
|
+
|
56
|
+
|
57
|
+
If you forgot to give the options when do 'configure' on toplevel
|
58
|
+
directry of Ruby sources, please try something like as the followings.
|
59
|
+
|
60
|
+
$ cd ext/tcltklib
|
61
|
+
$ rm Makefile
|
62
|
+
$ CONFIGURE_ARGS='--with-tcl-include=/usr/local/include/tcl8.4/ --with-tcllib=tcl8.4 --with-tklib=tk8.4' ruby extconf.rb
|
63
|
+
|
64
|
+
|
65
|
+
*** ATTENTION ***
|
66
|
+
When your Tcl/Tk libraries are compiled with "pthread support",
|
67
|
+
Ruby/Tk may cause "Hang-up" or "Segmentation Fault" frequently.
|
68
|
+
If you have such a trouble, please try to use the '--enable-pthread'
|
69
|
+
option of the 'configure' command and re-compile Ruby sources.
|
70
|
+
It may help you to avoid this trouble. The following configure
|
71
|
+
options may be useful.
|
72
|
+
|
73
|
+
--enable-tcl-thread/--disable-tcl-thread
|
74
|
+
--with-tclConfig-file=<path of 'tclConfig.sh'>
|
75
|
+
|
76
|
+
It is not need that 'tclConfig.sh' is a normal Tcl/Tk's tclConfig.sh.
|
77
|
+
But the file is expected to include the line "TCL_THREADS=0" or "...=1".
|
78
|
+
When no "TCL_THREADS=?" line, if Tcl version is 7.x or 8.0 which is
|
79
|
+
given by "TCL_MAJOR_VERSION=?" line and "TCL_MINOR_VERSION=?" line,
|
80
|
+
then --disable-tcl-thread is expected. Else, ignore the 'tclConfig.sh'.
|
81
|
+
If --enable-tcl-thread or --disable-tcl-thread option is given, then
|
82
|
+
--with-tclConfig-file option is ignored.
|
83
|
+
|
84
|
+
==========================================================
|
85
|
+
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
data/ext/depend
ADDED
data/ext/extconf.rb
ADDED
@@ -0,0 +1,451 @@
|
|
1
|
+
# extconf.rb for tcltklib
|
2
|
+
|
3
|
+
require 'mkmf'
|
4
|
+
|
5
|
+
is_win32 = (/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM)
|
6
|
+
#is_macosx = (/darwin/ =~ RUBY_PLATFORM)
|
7
|
+
|
8
|
+
have_func("ruby_native_thread_p", "ruby.h")
|
9
|
+
have_func("rb_errinfo", "ruby.h")
|
10
|
+
have_func("rb_safe_level", "ruby.h")
|
11
|
+
have_struct_member("struct RArray", "ptr", "ruby.h")
|
12
|
+
have_struct_member("struct RArray", "len", "ruby.h")
|
13
|
+
|
14
|
+
def find_framework(tcl_hdr, tk_hdr)
|
15
|
+
if framework_dir = with_config("tcltk-framework")
|
16
|
+
paths = [framework_dir]
|
17
|
+
else
|
18
|
+
unless tcl_hdr || tk_hdr ||
|
19
|
+
enable_config("tcltk-framework", false) ||
|
20
|
+
enable_config("mac-tcltk-framework", false)
|
21
|
+
return false
|
22
|
+
end
|
23
|
+
paths = ["/Library/Frameworks", "/System/Library/Frameworks"]
|
24
|
+
end
|
25
|
+
|
26
|
+
checking_for('Tcl/Tk Framework') {
|
27
|
+
paths.find{|dir|
|
28
|
+
dir.strip!
|
29
|
+
dir.chomp!('/')
|
30
|
+
(tcl_hdr || FileTest.directory?(dir + "/Tcl.framework/") ) &&
|
31
|
+
(tk_hdr || FileTest.directory?(dir + "/Tk.framework/") )
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
tcl_framework_header = with_config("tcl-framework-header")
|
37
|
+
tk_framework_header = with_config("tk-framework-header")
|
38
|
+
|
39
|
+
tcltk_framework = find_framework(tcl_framework_header, tk_framework_header)
|
40
|
+
|
41
|
+
unless is_win32
|
42
|
+
have_library("nsl", "t_open")
|
43
|
+
have_library("socket", "socket")
|
44
|
+
have_library("dl", "dlopen")
|
45
|
+
have_library("m", "log")
|
46
|
+
end
|
47
|
+
|
48
|
+
tk_idir, tk_ldir = dir_config("tk")
|
49
|
+
tcl_idir, tcl_ldir = dir_config("tcl")
|
50
|
+
x11_idir, x11_ldir = dir_config("X11")
|
51
|
+
|
52
|
+
tk_ldir2 = with_config("tk-lib")
|
53
|
+
tcl_ldir2 = with_config("tcl-lib")
|
54
|
+
x11_ldir2 = with_config("X11-lib")
|
55
|
+
|
56
|
+
tk_ldir_list = [tk_ldir2, tk_ldir]
|
57
|
+
tcl_ldir_list = [tcl_ldir2, tcl_ldir]
|
58
|
+
|
59
|
+
tklib = with_config("tklib")
|
60
|
+
tcllib = with_config("tcllib")
|
61
|
+
stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
|
62
|
+
|
63
|
+
tcltk_version = with_config("tcltkversion")
|
64
|
+
|
65
|
+
use_X = with_config("X11", (! is_win32))
|
66
|
+
|
67
|
+
def parse_tclConfig(file)
|
68
|
+
# check tclConfig.sh/tkConfig.sh
|
69
|
+
tbl = {}
|
70
|
+
IO.foreach(file){|line|
|
71
|
+
line.strip!
|
72
|
+
next if line !~ /^([^\#=][^=]*)=(['"]|)(.*)\2$/
|
73
|
+
key, val = $1, $3
|
74
|
+
tbl[key] = val.gsub(/\$\{([^}]+)\}/){|s| tbl[$1]} rescue nil
|
75
|
+
}
|
76
|
+
tbl
|
77
|
+
end
|
78
|
+
|
79
|
+
def check_tcltk_version(version)
|
80
|
+
return [nil, nil] unless version
|
81
|
+
|
82
|
+
version = version.strip
|
83
|
+
|
84
|
+
tclver = version.dup
|
85
|
+
tkver = version.dup
|
86
|
+
|
87
|
+
major = dot = minor = dot = plvl = ext = nil
|
88
|
+
|
89
|
+
if version =~ /^(\d)(\.?)(\d)(\.?)(\d*)(.*)$/
|
90
|
+
major = $1; minor_dot = $2; minor = $3; plvl_dot = $4; plvl = $5; ext = $6
|
91
|
+
dot = ! minor_dot.empty?
|
92
|
+
if plvl_dot.empty? && ! plvl.empty?
|
93
|
+
minor << plvl
|
94
|
+
end
|
95
|
+
elsif version =~ /^(\d)(\.?)(\d?)(.*)$/
|
96
|
+
major = $1; minor_dot = $2; minor = $3; ext = $4
|
97
|
+
dot = ! minor_dot.empty?
|
98
|
+
else # unknown -> believe user
|
99
|
+
return [tclver, tkver]
|
100
|
+
end
|
101
|
+
|
102
|
+
# check Tcl7.6 / Tk4.2 ?
|
103
|
+
if major == "7" # Tcl7.6 ( not support Tclversion < 7.6 )
|
104
|
+
# Tk4.2
|
105
|
+
tkver = "4" + ((dot)? ".": "") + ((minor.empty)? "": "2") + ext
|
106
|
+
elsif major == "4" # Tk4.2 ( not support Tkversion < 4.2 )
|
107
|
+
# Tcl7.6
|
108
|
+
tclver = "7" + ((dot)? ".": "") + ((minor.empty)? "": "6") + ext
|
109
|
+
end
|
110
|
+
|
111
|
+
[tclver, tkver]
|
112
|
+
end
|
113
|
+
|
114
|
+
def find_tcl(tcllib, stubs, version, *opt_paths)
|
115
|
+
default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
116
|
+
default_paths << "/Tcl/lib" # default for ActiveTcl
|
117
|
+
|
118
|
+
if (paths = opt_paths.compact).empty?
|
119
|
+
paths = default_paths
|
120
|
+
end
|
121
|
+
|
122
|
+
if stubs
|
123
|
+
func = "Tcl_InitStubs"
|
124
|
+
lib = "tclstub"
|
125
|
+
else
|
126
|
+
func = "Tcl_FindExecutable"
|
127
|
+
lib = "tcl"
|
128
|
+
end
|
129
|
+
|
130
|
+
if version && ! version.empty?
|
131
|
+
versions = [version]
|
132
|
+
else
|
133
|
+
versions = %w[8.4 8.7 8.6 8.5 8.3 8.2 8.1 8.0 7.6]
|
134
|
+
end
|
135
|
+
|
136
|
+
if tcllib
|
137
|
+
st = find_library(tcllib, func, *paths)
|
138
|
+
else
|
139
|
+
st = versions.find { |ver|
|
140
|
+
find_library("#{lib}#{ver}", func, *paths) or
|
141
|
+
find_library("#{lib}#{ver.delete('.')}", func, *paths) or
|
142
|
+
find_library("#{lib}#{ver}g", func, *paths) or
|
143
|
+
find_library("#{lib}#{ver.delete('.')}g", func, *paths) or
|
144
|
+
find_library("tcl#{ver}", func, *paths) or
|
145
|
+
find_library("tcl#{ver.delete('.')}", func, *paths) or
|
146
|
+
find_library("tcl#{ver}g", func, *paths) or
|
147
|
+
find_library("tcl#{ver.delete('.')}g", func, *paths)
|
148
|
+
} || (!version && find_library(lib, func, *paths))
|
149
|
+
end
|
150
|
+
|
151
|
+
unless st
|
152
|
+
puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
153
|
+
end
|
154
|
+
require 'display'
|
155
|
+
display st
|
156
|
+
st
|
157
|
+
end
|
158
|
+
|
159
|
+
def find_tk(tklib, stubs, version, *opt_paths)
|
160
|
+
default_paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
161
|
+
default_paths << "/Tcl/lib" # default for ActiveTcl
|
162
|
+
|
163
|
+
if (paths = opt_paths.compact).empty?
|
164
|
+
paths = default_paths
|
165
|
+
end
|
166
|
+
|
167
|
+
if stubs
|
168
|
+
func = "Tk_InitStubs"
|
169
|
+
lib = "tkstub"
|
170
|
+
else
|
171
|
+
func = "Tk_Init"
|
172
|
+
lib = "tk"
|
173
|
+
end
|
174
|
+
|
175
|
+
if version && ! version.empty?
|
176
|
+
versions = [version]
|
177
|
+
else
|
178
|
+
versions = %w[8.4 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
|
179
|
+
end
|
180
|
+
|
181
|
+
if tklib
|
182
|
+
st = find_library(tklib, func, *paths)
|
183
|
+
else
|
184
|
+
st = versions.find { |ver|
|
185
|
+
find_library("#{lib}#{ver}", func, *paths) or
|
186
|
+
find_library("#{lib}#{ver.delete('.')}", func, *paths) or
|
187
|
+
find_library("#{lib}#{ver}g", func, *paths) or
|
188
|
+
find_library("#{lib}#{ver.delete('.')}g", func, *paths) or
|
189
|
+
find_library("tk#{ver}", func, *paths) or
|
190
|
+
find_library("tk#{ver.delete('.')}", func, *paths) or
|
191
|
+
find_library("tk#{ver}g", func, *paths) or
|
192
|
+
find_library("tk#{ver.delete('.')}g", func, *paths)
|
193
|
+
} || (!version && find_library(lib, func, *paths))
|
194
|
+
end
|
195
|
+
|
196
|
+
unless st
|
197
|
+
puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
198
|
+
end
|
199
|
+
st
|
200
|
+
end
|
201
|
+
|
202
|
+
def find_tcltk_header(tclver, tkver)
|
203
|
+
base_dir = ['/usr/local/include', '/usr/pkg/include', '/usr/include']
|
204
|
+
base_dir << '/Tcl/include' # default for ActiveTcl
|
205
|
+
|
206
|
+
unless have_tcl_h = have_header('tcl.h')
|
207
|
+
if tclver && ! tclver.empty?
|
208
|
+
versions = [tclver]
|
209
|
+
else
|
210
|
+
versions = %w[8.4 8.7 8.6 8.5 8.3 8.2 8.1 8.0 7.6]
|
211
|
+
end
|
212
|
+
paths = base_dir.dup
|
213
|
+
versions.each{|ver| paths.concat(base_dir.map{|dir| dir + '/tcl' + ver})}
|
214
|
+
have_tcl_h = find_header('tcl.h', *paths)
|
215
|
+
end
|
216
|
+
|
217
|
+
unless have_tk_h = have_header("tk.h")
|
218
|
+
if tkver && ! tkver.empty?
|
219
|
+
versions = [tkver]
|
220
|
+
else
|
221
|
+
versions = %w[8.4 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
|
222
|
+
end
|
223
|
+
paths = base_dir.dup
|
224
|
+
versions.each{|ver| paths.concat(base_dir.map{|dir| dir + '/tk' + ver})}
|
225
|
+
have_tk_h = find_header('tk.h', *paths)
|
226
|
+
end
|
227
|
+
|
228
|
+
have_tcl_h && have_tk_h
|
229
|
+
end
|
230
|
+
|
231
|
+
def find_X11(*opt_paths)
|
232
|
+
default_paths =
|
233
|
+
[ "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib" ]
|
234
|
+
paths = opt_paths.compact.concat(default_paths)
|
235
|
+
st = find_library("X11", "XOpenDisplay", *paths)
|
236
|
+
unless st
|
237
|
+
puts("Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.")
|
238
|
+
end
|
239
|
+
st
|
240
|
+
end
|
241
|
+
|
242
|
+
def pthread_check()
|
243
|
+
tcl_major_ver = nil
|
244
|
+
tcl_minor_ver = nil
|
245
|
+
|
246
|
+
# Is tcl-thread given by user ?
|
247
|
+
case enable_config("tcl-thread")
|
248
|
+
when true
|
249
|
+
tcl_enable_thread = true
|
250
|
+
when false
|
251
|
+
tcl_enable_thread = false
|
252
|
+
else
|
253
|
+
tcl_enable_thread = nil
|
254
|
+
end
|
255
|
+
|
256
|
+
if (tclConfig = with_config("tclConfig-file"))
|
257
|
+
if tcl_enable_thread == true
|
258
|
+
puts("Warning: --with-tclConfig-file option is ignored, because --enable-tcl-thread option is given.")
|
259
|
+
elsif tcl_enable_thread == false
|
260
|
+
puts("Warning: --with-tclConfig-file option is ignored, because --disable-tcl-thread option is given.")
|
261
|
+
else
|
262
|
+
# tcl-thread is unknown and tclConfig.sh is given
|
263
|
+
begin
|
264
|
+
tbl = parse_tclConfig(tclConfig)
|
265
|
+
if tbl['TCL_THREADS']
|
266
|
+
tcl_enable_thread = (tbl['TCL_THREADS'] == "1")
|
267
|
+
else
|
268
|
+
tcl_major_ver = tbl['TCL_MAJOR_VERSION'].to_i
|
269
|
+
tcl_minor_ver = tbl['TCL_MINOR_VERSION'].to_i
|
270
|
+
if tcl_major_ver < 8 || (tcl_major_ver == 8 && tcl_minor_ver == 0)
|
271
|
+
tcl_enable_thread = false
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
if tcl_enable_thread == nil
|
276
|
+
# cannot find definition
|
277
|
+
if tcl_major_ver
|
278
|
+
puts("Warning: '#{tclConfig}' doesn't include TCL_THREADS definition.")
|
279
|
+
else
|
280
|
+
puts("Warning: '#{tclConfig}' may not be a tclConfig file.")
|
281
|
+
end
|
282
|
+
tclConfig = false
|
283
|
+
end
|
284
|
+
rescue Exception
|
285
|
+
puts("Warning: fail to read '#{tclConfig}'!! --> ignore the file")
|
286
|
+
tclConfig = false
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
if tcl_enable_thread == nil && !tclConfig
|
292
|
+
# tcl-thread is unknown and tclConfig is unavailable
|
293
|
+
begin
|
294
|
+
try_run_available = try_run("int main() { exit(0); }")
|
295
|
+
rescue Exception
|
296
|
+
# cannot try_run. Is CROSS-COMPILE environment?
|
297
|
+
puts(%Q'\
|
298
|
+
*****************************************************************************
|
299
|
+
**
|
300
|
+
** PTHREAD SUPPORT CHECK WARNING:
|
301
|
+
**
|
302
|
+
** We cannot check the consistency of pthread support between Ruby
|
303
|
+
** and the Tcl/Tk library in your environment (are you perhaps
|
304
|
+
** cross-compiling?). If pthread support for these 2 packages is
|
305
|
+
** inconsistent you may find you get errors when running Ruby/Tk
|
306
|
+
** (e.g. hangs or segmentation faults). We strongly recommend
|
307
|
+
** you to check the consistency manually.
|
308
|
+
**
|
309
|
+
*****************************************************************************
|
310
|
+
')
|
311
|
+
return true
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
if tcl_enable_thread == nil
|
316
|
+
# tcl-thread is unknown
|
317
|
+
if try_run(<<EOF)
|
318
|
+
#include <tcl.h>
|
319
|
+
int main() {
|
320
|
+
Tcl_Interp *ip;
|
321
|
+
ip = Tcl_CreateInterp();
|
322
|
+
exit((Tcl_Eval(ip, "set tcl_platform(threaded)") == TCL_OK)? 0: 1);
|
323
|
+
}
|
324
|
+
EOF
|
325
|
+
tcl_enable_thread = true
|
326
|
+
elsif try_run(<<EOF)
|
327
|
+
#include <tcl.h>
|
328
|
+
static Tcl_ThreadDataKey dataKey;
|
329
|
+
int main() { exit((Tcl_GetThreadData(&dataKey, 1) == dataKey)? 1: 0); }
|
330
|
+
EOF
|
331
|
+
tcl_enable_thread = true
|
332
|
+
else
|
333
|
+
tcl_enable_thread = false
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
# check pthread mode
|
338
|
+
if (macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"'))
|
339
|
+
# ruby -> enable
|
340
|
+
unless tcl_enable_thread
|
341
|
+
# ruby -> enable && tcl -> disable
|
342
|
+
puts(%Q'\
|
343
|
+
*****************************************************************************
|
344
|
+
**
|
345
|
+
** PTHREAD SUPPORT MODE WARNING:
|
346
|
+
**
|
347
|
+
** Ruby is compiled with --enable-pthread, but your Tcl/Tk library
|
348
|
+
** seems to be compiled without pthread support. Although you can
|
349
|
+
** create the tcltklib library, this combination may cause errors
|
350
|
+
** (e.g. hangs or segmentation faults). If you have no reason to
|
351
|
+
** keep the current pthread support status, we recommend you reconfigure
|
352
|
+
** and recompile the libraries so that both or neither support pthreads.
|
353
|
+
**
|
354
|
+
** If you want change the status of pthread support, please recompile
|
355
|
+
** Ruby without "--enable-pthread" configure option or recompile Tcl/Tk
|
356
|
+
** with "--enable-threads" configure option (if your Tcl/Tk is later
|
357
|
+
** than or equal to Tcl/Tk 8.1).
|
358
|
+
**
|
359
|
+
*****************************************************************************
|
360
|
+
')
|
361
|
+
end
|
362
|
+
|
363
|
+
# ruby -> enable && tcl -> enable/disable
|
364
|
+
if tcl_enable_thread
|
365
|
+
$CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
|
366
|
+
else
|
367
|
+
$CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
|
368
|
+
end
|
369
|
+
|
370
|
+
return true
|
371
|
+
|
372
|
+
else
|
373
|
+
# ruby -> disable
|
374
|
+
if tcl_enable_thread
|
375
|
+
# ruby -> disable && tcl -> enable
|
376
|
+
puts(%Q'\
|
377
|
+
*****************************************************************************
|
378
|
+
**
|
379
|
+
** PTHREAD SUPPORT MODE ERROR:
|
380
|
+
**
|
381
|
+
** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
|
382
|
+
** library seems to be compiled with pthread support. This
|
383
|
+
** combination may cause frequent hang or segmentation fault
|
384
|
+
** errors when Ruby/Tk is working. We recommend that you NEVER
|
385
|
+
** create the library with such a combination of pthread support.
|
386
|
+
**
|
387
|
+
** Please recompile Ruby with the "--enable-pthread" configure option
|
388
|
+
** or recompile Tcl/Tk with the "--disable-threads" configure option.
|
389
|
+
**
|
390
|
+
*****************************************************************************
|
391
|
+
')
|
392
|
+
$CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1'
|
393
|
+
return false
|
394
|
+
else
|
395
|
+
# ruby -> disable && tcl -> disable
|
396
|
+
$CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0'
|
397
|
+
return true
|
398
|
+
end
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
tclver, tkver = check_tcltk_version(tcltk_version)
|
403
|
+
|
404
|
+
if ( tcltk_framework ||
|
405
|
+
( find_tcltk_header(tclver, tkver) &&
|
406
|
+
( !use_X || find_X11(x11_ldir2, x11_ldir) ) &&
|
407
|
+
find_tcl(tcllib, stubs, tclver, *tcl_ldir_list) &&
|
408
|
+
find_tk(tklib, stubs, tkver, *tk_ldir_list) ) )
|
409
|
+
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
|
410
|
+
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
|
411
|
+
|
412
|
+
if tcltk_framework
|
413
|
+
if tcl_framework_header
|
414
|
+
$CPPFLAGS += " -I#{tcl_framework_header}"
|
415
|
+
else
|
416
|
+
$CPPFLAGS += " -I#{tcltk_framework}/Tcl.framework/Headers"
|
417
|
+
end
|
418
|
+
|
419
|
+
if tk_framework_header
|
420
|
+
$CPPFLAGS += " -I#{tk_framework_header}"
|
421
|
+
else
|
422
|
+
$CPPFLAGS += " -I#{tcltk_framework}/Tk.framework/Headers"
|
423
|
+
end
|
424
|
+
|
425
|
+
$LDFLAGS += ' -framework Tk -framework Tcl'
|
426
|
+
end
|
427
|
+
|
428
|
+
if stubs or pthread_check
|
429
|
+
# create Makefile
|
430
|
+
|
431
|
+
# for SUPPORT_STATUS
|
432
|
+
$INSTALLFILES ||= []
|
433
|
+
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
|
434
|
+
|
435
|
+
have_func("rb_hash_lookup", "ruby.h")
|
436
|
+
|
437
|
+
# create
|
438
|
+
$defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
|
439
|
+
$defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
|
440
|
+
create_makefile("tcltklib")
|
441
|
+
|
442
|
+
# ughly.
|
443
|
+
if RUBY_PLATFORM =~ /mingw/
|
444
|
+
old = File.read('Makefile')
|
445
|
+
old.gsub!('/Tcl', File.expand_path('/Tcl'))
|
446
|
+
File.open('Makefile', 'w') do |f| f.write old; end
|
447
|
+
end
|
448
|
+
|
449
|
+
end
|
450
|
+
|
451
|
+
end
|