caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* LablTk
@ 2001-01-25 16:28 wester
  2001-01-29 14:03 ` LablTk Jacques Garrigue
  0 siblings, 1 reply; 7+ messages in thread
From: wester @ 2001-01-25 16:28 UTC (permalink / raw)
  To: caml-list

Hi, 

I would like to use LablTk together with Bigarrays in the toplevel. 
Can I make my own toplevel with both modules linked in? I know
how to make it for Bigarrays alone and I know that labltk.exe (Windows)
is the toplevel with LablTk already linked in. But I couldn't figure out
how to make a toplevel with both Bigarrays and LablTk.

Besides this I couldn't find information about the modules Imagebitmap 
and Imagephoto which might be interesting for me. I have Ousterhouts 
Tcl/Tk book but couldn't find anything about this two modules.

I'have read that float arrays aren't boxed. Does this also hold for integers?
Considering speed are Bigarrays preferable? 

I would be very appreciative for any answers to my questions. 

I'm working on a project where I have to develop software for image 
processing and pattern recognition. I considered to make this in C++ or Java
because I'm quite familiar with these languages and graphical output can quite 
easily be done with both. On the other hand I like OCaml's toplevel because it makes
rapid prototyping very easy and I also would like to learn OCaml in order to
extend my programming skills. But the project has to be executed succesfully,
so I'm still undecided. 

Thank you in advance.

With kind regards.

Rolf Wester   

-------------------------------------
Rolf Wester
wester@ilt.fhg.de



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

* Re: LablTk
  2001-01-25 16:28 LablTk wester
@ 2001-01-29 14:03 ` Jacques Garrigue
  0 siblings, 0 replies; 7+ messages in thread
From: Jacques Garrigue @ 2001-01-29 14:03 UTC (permalink / raw)
  To: wester; +Cc: caml-list

From: wester@ilt.fhg.de

> I would like to use LablTk together with Bigarrays in the toplevel. 
> Can I make my own toplevel with both modules linked in? I know
> how to make it for Bigarrays alone and I know that labltk.exe (Windows)
> is the toplevel with LablTk already linked in. But I couldn't figure out
> how to make a toplevel with both Bigarrays and LablTk.

This is just the standard way, but you have to write the labltk path:
     ocamlmktop -o ocamlbigtk bigarray.cma -I /ocaml/lib/labltk labltk.cma

> Besides this I couldn't find information about the modules Imagebitmap 
> and Imagephoto which might be interesting for me. I have Ousterhouts 
> Tcl/Tk book but couldn't find anything about this two modules.

They are different types of images. You should get info under the
image, bitmap and photo names.

> I'have read that float arrays aren't boxed. Does this also hold for integers?
> Considering speed are Bigarrays preferable? 

Not my speciality, but if I remember correctly, not only integer
arrays are unboxed (no reason to box integers anywhere), but to get
the best efficiency you must use Array.unsafe_get, and tell the
compiler that your array contains integers (arr : int array), if it
cannot infer it.

Cheers,

Jacques
---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



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

* Re: LablTk
  2000-07-21  7:40   ` LablTk Fabien Fleutot
@ 2000-07-21  8:36     ` Jacques Garrigue
  0 siblings, 0 replies; 7+ messages in thread
From: Jacques Garrigue @ 2000-07-21  8:36 UTC (permalink / raw)
  To: fabien.fleutot; +Cc: caml-list

From: Fabien Fleutot <fabien.fleutot@inria.fr>

>    > - I want to prevent a window from being destroyed by the WM : it's a
>    > pretty long to build window, and I'd like to hide it instead of actually
>    > destroy it when the user clicks on the delete button of the window
>    > manager. It's easy to do in some langages such as Java, but I can't find
>    > the way to do it with Labltk.
> 
>    I do not see anything to do that in Tcl/Tk. You can iconify a window,
>    using Wm.iconify, but not hide it.
> 
> One can do it with ``Wm.withdraw''. This function exists in Labltk;
> the problem is to say it to use my own function rather than the
> standard delete function when the window destruction is requested by
> the Wm.

My mistake.
So your problem is how to bind the Destroy event, avoiding its actual
execution. And I don't know how it can be done; break does not work in
that specific case. Strangely enough, the window is only destroyed
after the script was executed, which gives you time to say to the user
that he has done something wrong, but there is no way to stop it.
Actually I would like to know, since I have uses for it.

>    If you really need this kind of power, you may consider switching to
>    GTK.
>
> ...as soon as it will be included in the standard OCaml
> distribution: I don't want people to have to download and install
> dozens of libs before being able to compile my soft, esp. on
> platforms other than linux.

Then you will have to stick to Tk, which is available on most platforms.
Having moving APIs in the standard distribution does not sound nice, and
LablGTK's API is not stable yet.

---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



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

* Re: LablTk
  2000-07-21  0:42 ` LablTk Jacques Garrigue
  2000-07-21  7:40   ` LablTk Fabien Fleutot
@ 2000-07-21  8:36   ` Axel Poigné
  1 sibling, 0 replies; 7+ messages in thread
From: Axel Poigné @ 2000-07-21  8:36 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: fabien.fleutot, caml-list



Jacques Garrigue wrote:
> 
> From: Fabien Fleutot <fabien.fleutot@inria.fr>
> 
> > I have two problems with LablTk :
> >
> > - I want to prevent a window from being destroyed by the WM : it's a
> > pretty long to build window, and I'd like to hide it instead of actually
> > destroy it when the user clicks on the delete button of the window
> > manager. It's easy to do in some langages such as Java, but I can't find
> > the way to do it with Labltk.
> 
> I do not see anything to do that in Tcl/Tk. You can iconify a window,
> using Wm.iconify, but not hide it.

You hide it by moving the window somewhere outside of the screen.

Axel poigne



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

* Re: LablTk
  2000-07-21  0:42 ` LablTk Jacques Garrigue
@ 2000-07-21  7:40   ` Fabien Fleutot
  2000-07-21  8:36     ` LablTk Jacques Garrigue
  2000-07-21  8:36   ` LablTk Axel Poigné
  1 sibling, 1 reply; 7+ messages in thread
From: Fabien Fleutot @ 2000-07-21  7:40 UTC (permalink / raw)
  To: garrigue; +Cc: caml-list

   > - I want to prevent a window from being destroyed by the WM : it's a
   > pretty long to build window, and I'd like to hide it instead of actually
   > destroy it when the user clicks on the delete button of the window
   > manager. It's easy to do in some langages such as Java, but I can't find
   > the way to do it with Labltk.

   I do not see anything to do that in Tcl/Tk. You can iconify a window,
   using Wm.iconify, but not hide it.

One can do it with ``Wm.withdraw''. This function exists in Labltk; the problem
is to say it to use my own function rather than the standard delete function
when the window destruction is requested by the Wm.

   If you really need this kind of power, you may consider switching to
   GTK.

...as soon as it will be included in the standard OCaml distribution: I don't
want people to have to download and install dozens of libs before being able to
compile my soft, esp. on platforms other than linux.



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

* Re: LablTk
  2000-07-10 13:51 LablTk Fabien Fleutot
@ 2000-07-21  0:42 ` Jacques Garrigue
  2000-07-21  7:40   ` LablTk Fabien Fleutot
  2000-07-21  8:36   ` LablTk Axel Poigné
  0 siblings, 2 replies; 7+ messages in thread
From: Jacques Garrigue @ 2000-07-21  0:42 UTC (permalink / raw)
  To: fabien.fleutot; +Cc: caml-list

From: Fabien Fleutot <fabien.fleutot@inria.fr>

> I have two problems with LablTk :
> 
> - I want to prevent a window from being destroyed by the WM : it's a
> pretty long to build window, and I'd like to hide it instead of actually
> destroy it when the user clicks on the delete button of the window
> manager. It's easy to do in some langages such as Java, but I can't find
> the way to do it with Labltk.

I do not see anything to do that in Tcl/Tk. You can iconify a window,
using Wm.iconify, but not hide it.
If you really need this kind of power, you may consider switching to
GTK.

> - I want to use a button to destroy a window. But I can't do
> 
> Button.create win ~text:"Close" ~command:(fun _ -> destroy win)
> 
> since when the destroy function starts, the button, which belongs to
> win, is in use and prevents to destroy its parent win. There is a
> specific function (i.e. Tk_EventuallyFree) in Tcl/Tk to handle such
> cases, but I don't know how to do with LablTk. What I'm currently doing
> is to put the destroying function in a Timer callback, to destroy the
> window .1s after the button has been released, but it's not very safe...

I don't see why your above code wouldn't work. I'm doing it everywhere in
ocamlbrowser (Jg_button.create_destroyer).

        Jacques
---------------------------------------------------------------------------
Jacques Garrigue      Kyoto University     garrigue at kurims.kyoto-u.ac.jp
		<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



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

* LablTk
@ 2000-07-10 13:51 Fabien Fleutot
  2000-07-21  0:42 ` LablTk Jacques Garrigue
  0 siblings, 1 reply; 7+ messages in thread
From: Fabien Fleutot @ 2000-07-10 13:51 UTC (permalink / raw)
  To: caml-list

I have two problems with LablTk :

- I want to prevent a window from being destroyed by the WM : it's a
pretty long to build window, and I'd like to hide it instead of actually
destroy it when the user clicks on the delete button of the window
manager. It's easy to do in some langages such as Java, but I can't find
the way to do it with Labltk.

- I want to use a button to destroy a window. But I can't do

Button.create win ~text:"Close" ~command:(fun _ -> destroy win)

since when the destroy function starts, the button, which belongs to
win, is in use and prevents to destroy its parent win. There is a
specific function (i.e. Tk_EventuallyFree) in Tcl/Tk to handle such
cases, but I don't know how to do with LablTk. What I'm currently doing
is to put the destroying function in a Timer callback, to destroy the
window .1s after the button has been released, but it's not very safe...



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

end of thread, other threads:[~2001-01-31 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-25 16:28 LablTk wester
2001-01-29 14:03 ` LablTk Jacques Garrigue
  -- strict thread matches above, loose matches on Subject: below --
2000-07-10 13:51 LablTk Fabien Fleutot
2000-07-21  0:42 ` LablTk Jacques Garrigue
2000-07-21  7:40   ` LablTk Fabien Fleutot
2000-07-21  8:36     ` LablTk Jacques Garrigue
2000-07-21  8:36   ` LablTk Axel Poigné

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).