From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA00952; Tue, 8 Jan 2002 11:04:10 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA01163 for ; Tue, 8 Jan 2002 11:04:09 +0100 (MET) Received: from ns.lami.univ-evry.fr (ns.lami.univ-evry.fr [195.221.162.248]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g08A49108415 for ; Tue, 8 Jan 2002 11:04:09 +0100 (MET) Received: from lami.univ-evry.fr (bio1.info.lami.univ-evry.fr [192.168.162.9]) by ns.lami.univ-evry.fr (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id LAA11577; Tue, 8 Jan 2002 11:04:07 +0100 X-Authentication-Warning: ns.lami.univ-evry.fr: Host bio1.info.lami.univ-evry.fr [192.168.162.9] claimed to be lami.univ-evry.fr Message-ID: <3C3AC417.1080305@lami.univ-evry.fr> Date: Tue, 08 Jan 2002 11:04:07 +0100 From: Franck Delaplace Organization: BioInfo Team , LaMI EVE (UMR 8042 CNRS) User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:0.9.2) Gecko/20010726 Netscape6/6.1 X-Accept-Language: fr-fr MIME-Version: 1.0 To: "Jose A. Ortega Ruiz" , OCAML Subject: Re: [Caml-list] ncurses bindings References: <86wuytyai7.fsf@holmes.localdomain> Content-Type: multipart/mixed; boundary="------------090005070508050708080303" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. --------------090005070508050708080303 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > "Jose A. Ortega Ruiz" wrote : >hi, >does anybody know of ocaml bindings for the ncurses lib? (i've looked >for them in the caml hump, and googled a little bit, without >luck)... and, if not, would you find them useful/interesting? (i'm >toying with the idea of writing them myself) >thanks for your help, I've build something for ncurses . It is a kernel for a GUI developped for ncurses. It is included in Tagcc an environment for gene annotation written in Ocaml (http://www.lami.univ-evry.fr/~delapla/tagcc/) . I've attached the library (.mli .c) The screen may be splitted into two "windows" : the "menu and status window" and the main window the scrolling is automatically performed in the main windows by the curses lib (Test every keys of the numerical pad) I hope this will help you -- Franck Delaplace @w3:http://www.lami.univ-evry.fr/~delapla/ Equipe BioInfo, La.M.I-U.M.R 8042 C.N.R.S 523 Place des Terrasses 91025 Evry CEDEX (France) --------------090005070508050708080303 Content-Type: text/plain; name="curses-1.mli" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="curses-1.mli" (* interface of curses *) (* Franck Delaplace : Mai 2001 *) external initscr :int->int-> unit = "cur_initscr" (* init main window (header size , nlines ) *) external win :unit->unit = "cur_win" (* commute to windows (every command are performed to windows)*) external header :unit->unit = "cur_head" (* commute to header *) external endscr :unit -> unit = "cur_endscr" (* close main window *) external init_pair :int->int->int = "cur_init_pair" (* set a color to a pair of color foreground background *) external init_color:int->int->int->int = "cur_init_pair" (* init_color i r g b changes a color of number i with r g b parameters *) external addch :char->unit = "cur_addch" (* add a character to the current cursor position *) external addstr :string->unit = "cur_addstr" (* add a string *) external addnstr :string->int->unit = "cur_addnstr" (* add a truncated string of n character *) external refresh :unit ->unit = "cur_refresh" (* refresh the screen *) external clear :unit ->unit = "cur_clear" (* clear the screen *) external move :int->int->unit = "cur_move" (* move the cursor to x y position *) external color :int->unit = "cur_color" (* set the color predefined by init_pair more than 50 colors are already predefined 0 cannot be changed by init_pair *) external screenon : unit -> unit = "cur_screenon" (* enable scroll and resize mode *) external isnew :unit->bool = "cur_isnew" (* check if a resize occurs (initial value true ) *) external iswait :unit->bool = "cur_iswait" (* check if a key should be pressed before refresh *) external getx :unit->int = "cur_getx" (* get the number of rows *) external keepy :int->unit = "cur_keepy" (* keep the y which is directly accessed by pressing insert *) external keyspace :unit->unit = "cur_keyspace" (* refresh and wait a key *) external normal:unit->unit = "cur_normal" (* set to normal (default) mode *) external bold :unit->unit = "cur_bold" (* bold (bright) *) external halfbold :unit->unit = "cur_halfbold" (* bold (bright) *) external standout :unit->unit = "cur_standout" (*standout*) external blink :unit->unit = "cur_blink" (* blink *) external reverse :unit->unit = "cur_reverse" (* reverse video *) external delch :unit->unit = "cur_delch" (* delete the character at the cursor position *) external delln :unit->unit = "cur_delln" (* delete the line under the cursor position *) external insertln :unit->unit = "cur_insertln" (* insert a blank line above the current line and the bottom line is lost *) external flash :unit->unit = "cur_flash" (* flash the screen *) --------------090005070508050708080303 Content-Type: text/plain; name="curses-1.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="curses-1.c" #include #include #define max(a,b) ((a>b)?a:b) #define min(a,b) ((a