* Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
@ 1998-11-06 22:49 Brian Rogoff
1998-11-09 13:54 ` Francois Pessaux
0 siblings, 1 reply; 6+ messages in thread
From: Brian Rogoff @ 1998-11-06 22:49 UTC (permalink / raw)
To: caml-list
Hi,
Has anyone built the the tk library with the latest stable
Tcl/Tk release (8.0.3) on Windows NT? I gave it a quick try, using
VC++ 5.0 as my C compiler, and it didn't work. If someone else has
done it I'd be grateful for the help. BTW, I'm using OCaml 2.00.
-- Brian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
1998-11-06 22:49 Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows? Brian Rogoff
@ 1998-11-09 13:54 ` Francois Pessaux
1998-11-09 19:11 ` Brian Rogoff
0 siblings, 1 reply; 6+ messages in thread
From: Francois Pessaux @ 1998-11-09 13:54 UTC (permalink / raw)
To: bpr, caml-list
Hello,
> Has anyone built the the tk library with the latest stable
> Tcl/Tk release (8.0.3) on Windows NT?
On Windows NT, I don't know. But we updated the ocamktk41-R200 in order
support Tcl/Tk8.0. I currently use it under Linux without any problem.
Did you try this version ?
--
(* Francois PESSAUX (Francois.Pessaux@inria.fr) *)
(* INRIA Rocquencourt - Projet CRISTAL *)
(* (http://pauillac.inria.fr/~pessaux) *)
;;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
1998-11-09 13:54 ` Francois Pessaux
@ 1998-11-09 19:11 ` Brian Rogoff
1998-11-10 8:54 ` Francois Pessaux
1998-11-12 0:06 ` Francois Rouaix
0 siblings, 2 replies; 6+ messages in thread
From: Brian Rogoff @ 1998-11-09 19:11 UTC (permalink / raw)
To: Francois Pessaux; +Cc: caml-list
Hi,
On Mon, 9 Nov 1998, Francois Pessaux wrote:
> Hello,
>
> > Has anyone built the the tk library with the latest stable
> > Tcl/Tk release (8.0.3) on Windows NT?
>
> On Windows NT, I don't know. But we updated the ocamktk41-R200 in order
> support Tcl/Tk8.0. I currently use it under Linux without any problem.
> Did you try this version ?
No, and unfortunately it isn't likely that I can switch to Linux.
It appears that the Tcl C interface has changed a bit in going from 7.6 to
8.0, and while the Unix port was not affected the Windows port was. The
relevant sections from the Tcl 8.0.3 distribution are:
8. Tcl_CreateFileHandler and Tcl_DeleteFileHandler now take Unix
fd's and are only supported on the Unix platform. Please use the
Tcl_CreateChannelHandler interface instead.
9. The C APIs for creating channel drivers have changed as part of
the new notifier implementation. The Tcl_File interfaces have been
removed. Tcl_GetChannelFile has been replaced with
Tcl_GetChannelHandle. Tcl_MakeFileChannel now takes a platform-
specific file handle. Tcl_DriverGetOptionProc procedures now take
an additional interp argument.
which affect the file ocamltk41\support\cltkFile.c, which uses the
obsolete Tcl_GetFile function and Tcl_File type. My perusal of the rest
of the sources didn't turn up any other porting issues, but I haven't
tried to rewrite and compile yet.
-- Brian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
1998-11-09 19:11 ` Brian Rogoff
@ 1998-11-10 8:54 ` Francois Pessaux
1998-11-12 0:06 ` Francois Rouaix
1 sibling, 0 replies; 6+ messages in thread
From: Francois Pessaux @ 1998-11-10 8:54 UTC (permalink / raw)
To: bpr, caml-list
Hi,
> It appears that the Tcl C interface has changed a bit in going from 7.6 to
> 8.0, and while the Unix port was not affected the Windows port was.
Unix port *was* also affected. We had to write a patch to compile the whole
stuff.
> which affect the file ocamltk41\support\cltkFile.c, which uses the
> obsolete Tcl_GetFile function and Tcl_File type.
If TCL_MAJOR_VERSION is defined >= 8 then the compiled source will use the new
Tcl_GetFile.
cltkEval.c, cltkImg.c, cltkFile.c where patched to use the new API (you can
find locations by "grep-ing" TCL_MAJOR_VERSION or 8).
That's strange, because all you said seems to be patched in the last release.
Make sure that when compiling, TCL_MAJOR_VERSION is defined and >= 8.
If the problems are still present, then we should have a look with Francois
Rouaix.
--Francois
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
1998-11-09 19:11 ` Brian Rogoff
1998-11-10 8:54 ` Francois Pessaux
@ 1998-11-12 0:06 ` Francois Rouaix
1998-11-12 13:10 ` Xavier Leroy
1 sibling, 1 reply; 6+ messages in thread
From: Francois Rouaix @ 1998-11-12 0:06 UTC (permalink / raw)
To: Brian Rogoff; +Cc: Francois Pessaux, caml-list
Brian,
You're right, the quick fixes I made for CamlTk to run with Tcl/Tk 8.0
will not work on Windows NT. The proper fix would be to use
Tcl_CreateChannelHandler (Tcl_MakeFileChannel (some_descriptor))
where some_descriptor is the file descriptor under Unix, and a HANDLE under
Windows.
Unfortunately, I didn't have time to look into the Windows version of
our libunix library to see what notion of file descriptor/handle we are
using there, and if it fits our purpose. You might want to check that
with Xavier, who is the main perpetrator of this library.
--f
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
1998-11-12 0:06 ` Francois Rouaix
@ 1998-11-12 13:10 ` Xavier Leroy
0 siblings, 0 replies; 6+ messages in thread
From: Xavier Leroy @ 1998-11-12 13:10 UTC (permalink / raw)
To: frouaix, Brian Rogoff; +Cc: caml-list
> The proper fix would be to use
> Tcl_CreateChannelHandler (Tcl_MakeFileChannel (some_descriptor))
> where some_descriptor is the file descriptor under Unix, and a HANDLE under
> Windows.
> Unfortunately, I didn't have time to look into the Windows version of
> our libunix library to see what notion of file descriptor/handle we are
> using there, and if it fits our purpose. You might want to check that
> with Xavier, who is the main perpetrator of this library.
^^^^^^^^^^^
Well, Win32 programming is not a crime; a misdemeanor, perhaps...
At any rate, the Windows version of libunix uses Win32 native HANDLE
to represent the type Unix.file_descriptor. (Initially, we used
Visual C++'s emulation of Unix file descriptors, but it was too buggy.)
So, it should work with Tcl_MakeFileChannel.
To extract the HANDLE from a Caml value of type Unix.file_descriptor,
just use the following handy macro (found in
otherlibs/win32unix/unixsupport.h):
#define Handle_val(v) (*((HANDLE *)(v)))
If anyone gets Tk 8.0 to work under Windows, please send us the
patches.
Best regards,
- Xavier Leroy
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1998-11-12 17:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-06 22:49 Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows? Brian Rogoff
1998-11-09 13:54 ` Francois Pessaux
1998-11-09 19:11 ` Brian Rogoff
1998-11-10 8:54 ` Francois Pessaux
1998-11-12 0:06 ` Francois Rouaix
1998-11-12 13:10 ` Xavier Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox