curses: add box word, rearrange some code

db4
Philipp Brüschweiler 2009-10-25 23:03:03 +01:00
parent f768bbe59e
commit 6c31c49cad
2 changed files with 19 additions and 4 deletions

View File

@ -254,7 +254,7 @@ PRIVATE>
ptr>> swap window-params ffi:derwin
] [
window-params ffi:newwin
] if* [ curses-error ] keep >>ptr &dispose
] if* curses-pointer-error >>ptr &dispose
] [ apply-window-options ] bi ;
: with-window ( window quot -- )
@ -266,9 +266,13 @@ PRIVATE>
'[
ffi:initscr curses-pointer-error
>>ptr
[ apply-global-options ] [ apply-window-options ] [ ] tri
ffi:erase curses-error
{
[ apply-global-options ]
[ apply-window-options ]
[ ptr>> ffi:wclear curses-error ]
[ ptr>> ffi:wrefresh curses-error ]
[ ]
} cleave
init-colors
_ with-window
@ -402,3 +406,9 @@ PRIVATE>
: ccolor ( foreground background -- )
current-window get wccolor ;
: wccbox ( window -- )
ptr>> 0 0 ffi:box curses-error ;
: cbox ( -- )
current-window get wccbox ;

View File

@ -274,3 +274,8 @@ FUNCTION: bool wenclose ( WINDOW* win, int y, int x ) ;
FUNCTION: bool mouse_trafo ( int* pY, int* pX, bool to_screen ) ;
FUNCTION: bool wmouse_trafo ( WINDOW* win, int* pY, int* pX, bool to_screen ) ;
FUNCTION: int mouseinterval ( int erval ) ;
FUNCTION: int wborder ( WINDOW* win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br ) ;
FUNCTION: int box ( WINDOW* win, chtype verch, chtype horch ) ;
FUNCTION: int whline ( WINDOW* win, chtype ch, int n ) ;
FUNCTION: int wvline ( WINDOW* win, chtype ch, int n ) ;