ocaml-tmk-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ocaml-tmk-devel] Handling xterm resizing


From: Richard Jones
Subject: Re: [Ocaml-tmk-devel] Handling xterm resizing
Date: Fri, 29 Oct 2010 08:40:24 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Oct 29, 2010 at 04:40:21PM +1100, Erik de Castro Lopo wrote:
> HI all,
> 
> I have a trivial Ocaml/curses program below. I'd like for the program
> to redraw its window when the window is resized, but this is not
> happening. Clues?
> 
> Cheers,
> Erik
> 
> 
> let () =
>       Curses.ripoffline true ;
>       let w = Curses.initscr () in
> 
>       (       try Curses.winch_handler_on ()
>               with Invalid_argument "winch_handler_on" -> ()
>               ) ;
> 
>       let () = assert (Curses.start_color ()) in
>       assert (Curses.init_pair 1 Curses.Color.white Curses.Color.red) ;
> 
>       assert (Curses.cbreak ()) ;
>       assert (Curses.noecho ()) ;
>       assert (Curses.intrflush w false) ;
>       assert (Curses.keypad w true) ;
> 
>       Curses.border 0 0 0 0 0 0 0 0 ;
>       Curses.wborder w 0 0 0 0 0 0 0 0 ;
> 
>       let (trows, tcols) = Curses.get_size () in
>       ignore (Curses.getch ()) ;
>       Curses.endwin () ;
> 
>       Printf.printf "Term size : %d x %d\n" trows tcols ;

Actually I have no clue.  How does it work in C?  It
likely works the same way in ocaml-curses.

Rich.

-- 
Richard Jones
Red Hat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]