summaryrefslogtreecommitdiff
path: root/ext/tk/stubs.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-31 14:50:39 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-31 14:50:39 +0000
commitd369a50c2bb5f40dee850b4de5f091b4a69181d4 (patch)
tree9fa2f029331d3398b891143dc680a18c7db29dda /ext/tk/stubs.c
parenta4702079b844cf415c047cbd45a501a13a0e0a23 (diff)
* ext/tk/extconf.rb: use tclConfig.sh/tkConfig.sh when frameworks
are enabled on MacOS X. * ext/tk/stubs.c: dirty hack for frameworks and stubs on MacOS X. * ext/tk/lib/tk.rb: stop creating a dummy Tcl/Tk interpreter. And hide a root window before starting eventloop. (for ruby 1.9) * ext/tk/tcltklib.c: add codes to support Ruby/Tk-Kit (Rubykit). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/stubs.c')
-rw-r--r--ext/tk/stubs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 712c5ced9f..d76e0c8632 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -92,6 +92,10 @@ _nativethread_consistency_check(ip)
# define TK_INDEX 7
# define TCL_NAME "libtcl8.9%s"
# define TK_NAME "libtk8.9%s"
+# if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
+# undef DLEXT
+# define DLEXT ".dylib"
+# endif
#endif
static DL_HANDLE tcl_dll = (DL_HANDLE)0;
@@ -321,6 +325,22 @@ ruby_tk_stubs_init(tcl_ip)
if (!p_Tk_Init)
return NO_Tk_Init;
+#if defined USE_TK_STUBS && defined TK_FRAMEWORK && defined(__APPLE__) && defined(__MACH__)
+ /*
+ FIX ME : dirty hack for Mac OS X frameworks.
+ With stubs, fails to find Resource/Script directory of Tk.framework.
+ So, teach it to a Tcl interpreter by an environment variable.
+ e.g. when $tcl_library ==
+ /Library/Frameworks/Tcl.framwwork/8.5/Resources/Scripts
+ ==> /Library/Frameworks/Tk.framwwork/8.5/Resources/Scripts
+ */
+ if (Tcl_Eval(tcl_ip,
+ "if {[array get env TK_LIBRARY] == {}} { set env(TK_LIBRARY) [regsub -all -nocase {(t)cl} $tcl_library {\\1k}] }"
+ ) != TCL_OK) {
+ return FAIL_Tk_Init;
+ }
+#endif
+
if ((*p_Tk_Init)(tcl_ip) == TCL_ERROR)
return FAIL_Tk_Init;