caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Native labltk for Mac OS X
@ 2003-01-07 11:26 Ken Wakita
  2003-01-08  4:33 ` Ken Wakita
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Wakita @ 2003-01-07 11:26 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]


Today I found some time to install Tcl/Tk for Aqua, which is the native user
interface for Macintosh OS X and configured ocaml-3.06 so that its labltk
links with the Tcl/Tk for Aqua.

labltk, ocamlbrowser, and accompanying examples (hello, eyes, tetris, ...)
under otherlibs/labltk/examples_labltk compiles with little problem.

With a small effort you could make a clickable native application for Mac OS
X.

Though behavior of some applications is weird (some, for instance
ocamlbrowser, are very weird) but I can tolerate.

The following is an outline of installation steps (Mac OS 10.2.2 and higher
is expected):

0. Visit "www.tcl.tk" and get TclTkAqua_8.4.1-Jaguar.dmg, and install it.

After installation make four symbolic links as show followingly (you need to
be a super user):

/Library/Frameworks/Tcl.framework:

lr-xr-xr-x  1 root  staff   11 Jan  7 18:58 libtcl -> libtcl8.4.a
lr-xr-xr-x  1 root  staff   16 Jan  7 18:58 libtcl8.4.a -> Versions/8.4/Tcl

/Library/Frameworks/Tk.framework:

lr-xr-xr-x  1 root  staff   10 Jan  7 18:58 libTk -> libTk8.4.a
lr-xr-xr-x  1 root  staff   15 Jan  7 18:58 libTk8.4.a -> Versions/8.4/Tk

1. Extract ocaml-3.06.tgz and apply the attached patch (tcltk4aqua.patch)

cd ocaml-3.06; patch -p1 tcltk4aqua.patch

2. Execute the configuration script

sh ocaml4darwin.conf

This script configures ocaml-3.06 for Mac OS X and for the Tcl/Tk just
installed.  It also builds "world, opt, and opt.opt".

 You might want to save the existing ocaml-3.06 installation.  In that case,
modify the script appropriately.

3. Install the ocaml-3.06 system

make install

4. Store makeapp.sh and Info.plist at the labltk's examples directory and
build clickable applications.

4.1 store makeapp.sh and Info.plist in "otherlibs/labltk/examples_labltk"
directory.

4.2 build examples

cd otherlibs/labltk/examples_labltk
make

4.3 build clickable applications

./makeapp hello
./makeapp tetris
...

4.4 locate the Finder application to the examples_labltk directory and start
the clickable applications.

Good luck

Ken
 


[-- Attachment #2: tcltk4aqua.patch --]
[-- Type: application/octet-stream, Size: 3255 bytes --]

diff -c -r ocaml-3.06/configure ocaml-ken/configure
*** ocaml-3.06/configure	Wed Aug  7 21:45:00 2002
--- ocaml-ken/configure	Tue Jan  7 15:28:58 2003
***************
*** 1269,1274 ****
--- 1269,1275 ----
    fi
  fi
  
+ export verbose=yes
  tkauxlibs="$mathlib $dllib"
  tcllib=''
  tklib=''
***************
*** 1307,1312 ****
--- 1308,1314 ----
      has_tk=false
    fi
  fi
+ verbose=no
  
  if test $has_tk = true; then
    if test $tk_x11 = yes; then
diff -c -r ocaml-3.06/otherlibs/labltk/browser/main.ml ocaml-ken/otherlibs/labltk/browser/main.ml
*** ocaml-3.06/otherlibs/labltk/browser/main.ml	Tue Aug  6 18:17:26 2002
--- ocaml-ken/otherlibs/labltk/browser/main.ml	Tue Jan  7 18:49:59 2003
***************
*** 88,97 ****
          \032    X/x enable/disable all other warnings\n\
          \032    default setting is \"Al\" (all warnings but labels enabled)" ]
    and errmsg = "Command line: ocamlbrowser <options>" in
!   if not (check ~spec Sys.argv) then fatal_error (usage ~spec errmsg);
    Arg.parse spec
      (fun name -> raise(Arg.Bad("don't know what to do with " ^ name)))
      errmsg;
    Config.load_path :=
      Sys.getcwd ()
      :: List.rev_map ~f:(Misc.expand_directory Config.standard_library) !path
--- 88,99 ----
          \032    X/x enable/disable all other warnings\n\
          \032    default setting is \"Al\" (all warnings but labels enabled)" ]
    and errmsg = "Command line: ocamlbrowser <options>" in
! (*
!   if not (check ~spec argv) then fatal_error (usage ~spec errmsg);
    Arg.parse spec
      (fun name -> raise(Arg.Bad("don't know what to do with " ^ name)))
      errmsg;
+ *)
    Config.load_path :=
      Sys.getcwd ()
      :: List.rev_map ~f:(Misc.expand_directory Config.standard_library) !path
diff -c -r ocaml-3.06/otherlibs/labltk/support/cltkImg.c ocaml-ken/otherlibs/labltk/support/cltkImg.c
*** ocaml-3.06/otherlibs/labltk/support/cltkImg.c	Tue Jul 23 23:11:59 2002
--- ocaml-ken/otherlibs/labltk/support/cltkImg.c	Tue Jan  7 18:05:24 2003
***************
*** 99,105 ****
    pib.offset[0] = 0;
    pib.offset[1] = 1;
    pib.offset[2] = 2;
!   Tk_PhotoPutBlock(ph,&pib,Int_val(x),Int_val(y),Int_val(w),Int_val(h)); 
  }
  
  CAMLprim void camltk_setimgdata_bytecode(argv,argn)
--- 99,105 ----
    pib.offset[0] = 0;
    pib.offset[1] = 1;
    pib.offset[2] = 2;
!   Tk_PhotoPutBlock(ph,&pib,Int_val(x),Int_val(y),Int_val(w),Int_val(h), TK_PHOTO_COMPOSITE_OVERLAY); 
  }
  
  CAMLprim void camltk_setimgdata_bytecode(argv,argn)
diff -c -r ocaml-3.06/otherlibs/labltk/tkanim/tkAnimGIF.c ocaml-ken/otherlibs/labltk/tkanim/tkAnimGIF.c
*** ocaml-3.06/otherlibs/labltk/tkanim/tkAnimGIF.c	Tue Jul 23 23:12:00 2002
--- ocaml-ken/otherlibs/labltk/tkanim/tkAnimGIF.c	Tue Jan  7 18:14:54 2003
***************
*** 336,342 ****
              }
          }
          Tk_PhotoPutBlock(photoHandle, &block, 0, 0, 
!                          imageWidth, imageHeight);
  #ifdef TKANIM_DEBUG
      fprintf(stderr, " Retrieving result\n");
  #endif
--- 336,342 ----
              }
          }
          Tk_PhotoPutBlock(photoHandle, &block, 0, 0, 
!                          imageWidth, imageHeight, TK_PHOTO_COMPOSITE_OVERLAY);
  #ifdef TKANIM_DEBUG
      fprintf(stderr, " Retrieving result\n");
  #endif

[-- Attachment #3: ocaml4darwin.conf --]
[-- Type: application/octet-stream, Size: 265 bytes --]

TCLDIR=/Library/Frameworks/Tcl.framework
TKDIR=/Library/Frameworks/Tk.framework
INCS="-I$TCLDIR/Headers -I$TKDIR/Headers"
LIBS="-L$TCLDIR -lTcl -L$TKDIR -lTk"

./configure \
	-tk-no-x11 \
	-tkdefs "$INCS" \
	-tklibs "$LIBS"

ulimit -s 65536

make world opt opt.opt

[-- Attachment #4: makeapp.sh --]
[-- Type: application/octet-stream, Size: 141 bytes --]

#!/bin/sh

app=$1
mkdir -p $app.app/Contents/MacOS
cp $app $app.app/Contents/MacOS
sed s/APP/$app/ Info.plist > $app.app/Contents/Info.plist

[-- Attachment #5: Info.plist --]
[-- Type: application/octet-stream, Size: 218 bytes --]

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
	<key>CFBundleExecutable</key>
	<string>APP</string>
</dict>
</plist>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-07 11:26 [Caml-list] Native labltk for Mac OS X Ken Wakita
@ 2003-01-08  4:33 ` Ken Wakita
  2003-01-08  8:53   ` Sven Luther
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Wakita @ 2003-01-08  4:33 UTC (permalink / raw)
  To: caml-list


Yesterday, I reported that it is possible to build native clickable
application using slightly modified ocaml-3.06 and Tcl/Tk.  I found a
critical problem that occasionally kills the Finder and other applications.

The reason seems that the native applications as suggested in my yesterday's
fails to handle user interaction as expected by Mac OS.  I try to fix this
problem.  For the moment, native labltk is recommended only for the brave.

Ken

> From: Ken Wakita <wakita@is.titech.ac.jp>
> Date: Tue, 07 Jan 2003 20:26:48 +0900
> To: caml-list <caml-list@inria.fr>
> Subject: [Caml-list] Native labltk for Mac OS X
> 
> Today I found some time to install Tcl/Tk for Aqua, which is the native user
> interface for Macintosh OS X and configured ocaml-3.06 so that its labltk
> links with the Tcl/Tk for Aqua.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-08  4:33 ` Ken Wakita
@ 2003-01-08  8:53   ` Sven Luther
  2003-01-08 11:17     ` Ken Wakita
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Luther @ 2003-01-08  8:53 UTC (permalink / raw)
  To: Ken Wakita; +Cc: caml-list

On Wed, Jan 08, 2003 at 01:33:37PM +0900, Ken Wakita wrote:
> 
> Yesterday, I reported that it is possible to build native clickable
> application using slightly modified ocaml-3.06 and Tcl/Tk.  I found a
> critical problem that occasionally kills the Finder and other applications.

BTW, have you tried gtk+osx (http://gtk-osx.sourceforge.net/). It is a
gtk+ 1.2 with native mac OS X support, and supposedly lablgtk should
work just fine on it. That said, it is possible that they are not yet
enough advanced to provide all hte widgets lablgtk need, but then, they
build film-gimp, so it should be pretty complete, i think.

I have not tried it though, as i don't have any OS X hardware.

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-08  8:53   ` Sven Luther
@ 2003-01-08 11:17     ` Ken Wakita
  2003-01-08 11:23       ` Sven Luther
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Wakita @ 2003-01-08 11:17 UTC (permalink / raw)
  To: Sven Luther, caml-list


Thanks for the information about gtk-osx.  I will try it.

I continue my effort as I want native ocamlbrowser to browse lablgtk
documents.

Ken

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-08 11:17     ` Ken Wakita
@ 2003-01-08 11:23       ` Sven Luther
  2003-01-09  9:12         ` Jacques Garrigue
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Luther @ 2003-01-08 11:23 UTC (permalink / raw)
  To: Ken Wakita; +Cc: Sven Luther, caml-list

On Wed, Jan 08, 2003 at 08:17:54PM +0900, Ken Wakita wrote:
> 
> Thanks for the information about gtk-osx.  I will try it.
> 
> I continue my effort as I want native ocamlbrowser to browse lablgtk
> documents.

Mmm, i think there is also a lablgtk based ocamlbrowser, ..., yes there
is, altough it is not build per default, needs the ocaml sources, and
failed to build, altough i did not take time to check the error (it
speaks about not finding the Parser module).

Jacques, could you comment on the status of lablgtk-ocamlbrowser ?

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-08 11:23       ` Sven Luther
@ 2003-01-09  9:12         ` Jacques Garrigue
  2003-01-09 12:00           ` Ken Wakita
  2003-01-09 12:46           ` Sven Luther
  0 siblings, 2 replies; 8+ messages in thread
From: Jacques Garrigue @ 2003-01-09  9:12 UTC (permalink / raw)
  To: luther; +Cc: caml-list

From: Sven Luther <luther@dpt-info.u-strasbg.fr>
> On Wed, Jan 08, 2003 at 08:17:54PM +0900, Ken Wakita wrote:
> > Thanks for the information about gtk-osx.  I will try it.
> > 
> > I continue my effort as I want native ocamlbrowser to browse lablgtk
> > documents.
> 
> Mmm, i think there is also a lablgtk based ocamlbrowser, ..., yes there
> is, altough it is not build per default, needs the ocaml sources, and
> failed to build, altough i did not take time to check the error (it
> speaks about not finding the Parser module).

I indeed tried once to port ocamlbrowser to lablgtk, but quickly
realized that the text widget was much too weak for that.
That attempt is applications/browser, and is only updated once in a
while.

But with GTK2 this shall become possible.
I must just find some time to do that, knowing that ocamlbrowser is
rather dirty code, with lots of dependencies on Tk.

By the way, gtk-osx is 1.2-based, not 2.2.  And it is carbonized
rather cocoated.  Doesn't seem so attractive, but I definitely hope we
get a nice aqua gtk at some point.

Cheers,

Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-09  9:12         ` Jacques Garrigue
@ 2003-01-09 12:00           ` Ken Wakita
  2003-01-09 12:46           ` Sven Luther
  1 sibling, 0 replies; 8+ messages in thread
From: Ken Wakita @ 2003-01-09 12:00 UTC (permalink / raw)
  To: Jacques Garrigue, luther; +Cc: caml-list


> From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
> Date: Thu, 09 Jan 2003 18:12:21 +0900
> Subject: Re: [Caml-list] Native labltk for Mac OS X
> 
> By the way, gtk-osx is 1.2-based, not 2.2.  And it is carbonized
> rather cocoated.  Doesn't seem so attractive, but I definitely hope we
> get a nice aqua gtk at some point.

Thanks for this information.  I realized that tcltk for macosx is carbonized
implementation as well.  It seems that carbonized labltk is useful for the
moment.  Now I am looking into the bootstrap code for Tk and labltk and I
think I found a clue to fix the problem.  When I am finished I will send you
my patch.

Ken

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Native labltk for Mac OS X
  2003-01-09  9:12         ` Jacques Garrigue
  2003-01-09 12:00           ` Ken Wakita
@ 2003-01-09 12:46           ` Sven Luther
  1 sibling, 0 replies; 8+ messages in thread
From: Sven Luther @ 2003-01-09 12:46 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: luther, caml-list

On Thu, Jan 09, 2003 at 06:12:21PM +0900, Jacques Garrigue wrote:
> But with GTK2 this shall become possible.
> I must just find some time to do that, knowing that ocamlbrowser is
> rather dirty code, with lots of dependencies on Tk.
> 
> By the way, gtk-osx is 1.2-based, not 2.2.  And it is carbonized

For now but there are plans to port it to 2.2 nextly.

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-01-09 12:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 11:26 [Caml-list] Native labltk for Mac OS X Ken Wakita
2003-01-08  4:33 ` Ken Wakita
2003-01-08  8:53   ` Sven Luther
2003-01-08 11:17     ` Ken Wakita
2003-01-08 11:23       ` Sven Luther
2003-01-09  9:12         ` Jacques Garrigue
2003-01-09 12:00           ` Ken Wakita
2003-01-09 12:46           ` Sven Luther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).