NEW trial (RC?) version of Ruby/Tk

H

Hidetoshi NAGAI

Hi,

I release the new trial (RC?) version.
There are many changes between previous trial varsion.

# The file size of 'diff -urN' is about 1.4 MB. :)

Changes are ...

* bug fix.
* some parts are re-implemented by C.
* split each library file to smaller files.
( It will make start-up speed faster. )
* new libraries and new samples.

Huge part of libraries are edited. (It may nearly re-born.)
But, I think, backward compatibility will be kept except
differences depends on bugs.

Please get the source archive from
http://www.dumbo.ai.kyutech.ac.jp/~nagai/rbtk20040414.tar.gz

It includes two directories; tcltklib and tk. Please replace same
name directories of Ruby source tree (under 'ext' directory),
compile, and install them. They will work with Ruby 1.8.1+ and 1.9.0.

Your comments and bug reports are welcome.
 
H

Hidetoshi NAGAI

----Next_Part(Thu_Apr_15_00:12:59_2004_697)--
Content-Type: Multipart/Mixed;
boundary="--Next_Part(Thu_Apr_15_00:12:59_2004_697)--"

----Next_Part(Thu_Apr_15_00:12:59_2004_697)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

From: Hidetoshi NAGAI <[email protected]>
Subject: NEW trial (RC?) version of Ruby/Tk
Date: Wed, 14 Apr 2004 21:51:02 +0900
Message-ID: said:

I'm very sorry. It's cannot be compiled with Tcl/Tk8.0.
Please apply the attached patch.
--
Hidetoshi NAGAI ([email protected])

----Next_Part(Thu_Apr_15_00:12:59_2004_697)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=diff20040415

diff -ur ../20040414/tcltklib/extconf.rb ./tcltklib/extconf.rb
--- ../20040414/tcltklib/extconf.rb 2004-04-14 21:13:53.000000000 +0900
+++ ./tcltklib/extconf.rb 2004-04-15 00:04:36.000000000 +0900
@@ -102,7 +102,7 @@
**
** Ruby is compiled with --enable-pthread, but your Tcl/Tk libraries
** seems to be compiled without "pthread support". Although You can
-** create tcltklib library, this combination may causes memory trouble
+** create tcltklib library, this combination may cause memory trouble
** (e.g. "Hang-up" or "Segmentation Fault"). We recommend you to make
** both or neither support pthread.
**
diff -ur ../20040414/tcltklib/tcltklib.c ./tcltklib/tcltklib.c
--- ../20040414/tcltklib/tcltklib.c 2004-04-14 21:13:53.000000000 +0900
+++ ./tcltklib/tcltklib.c 2004-04-15 00:03:17.000000000 +0900
@@ -1184,6 +1184,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1198,7 +1201,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -1223,6 +1226,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1237,7 +1243,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -1252,6 +1258,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1266,7 +1275,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -1625,6 +1634,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1639,7 +1651,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -1664,6 +1676,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1678,7 +1693,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -1693,6 +1708,9 @@
/* StringValue(res); */
res = rb_funcall(res, ID_message, 0, 0);

+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0
+ Tcl_AppendResult(interp, RSTRING(res)->ptr, (char*)NULL);
+#else
/* to avoid a garbled error message dialog */
buf = ALLOC_N(char,(RSTRING(res)->len)+1);
strncpy(buf, RSTRING(res)->ptr, RSTRING(res)->len);
@@ -1707,7 +1725,7 @@
DUMP2("error message:%s", Tcl_DStringValue(&dstr));

free(buf);
-
+#endif
rb_thread_critical = thr_crit_bup;

return TCL_ERROR;
@@ -3495,8 +3513,9 @@
VALUE src;
VALUE encodename;
{
-#ifdef TCL_UTF_MAX
volatile VALUE str = src;
+
+#ifdef TCL_UTF_MAX
Tcl_Interp *interp;
Tcl_Encoding encoding;
Tcl_DString dstr;
@@ -3622,8 +3641,9 @@
VALUE src;
VALUE encodename;
{
-#ifdef TCL_UTF_MAX
volatile VALUE str = src;
+
+#ifdef TCL_UTF_MAX
Tcl_Interp *interp;
Tcl_Encoding encoding;
Tcl_DString dstr;
diff -ur ../20040414/tk/tkutil.c ./tk/tkutil.c
--- ../20040414/tk/tkutil.c 2004-04-14 21:13:53.000000000 +0900
+++ ./tk/tkutil.c 2004-04-15 00:03:32.000000000 +0900
@@ -1067,7 +1067,13 @@
tkobj_path(self)
VALUE self;
{
- return rb_ivar_get(self, ID_path);
+ volatile VALUE val = rb_ivar_get(self, ID_path);
+
+ if (NIL_P(val)) {
+ return rb_str_new2("");
+ } else {
+ return val;
+ }
}

/*************************************/

----Next_Part(Thu_Apr_15_00:12:59_2004_697)----
----Next_Part(Thu_Apr_15_00:12:59_2004_697)----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top