in reply to Center curses output

Is this a Perl question? In order to get a useful answer you probably have to provide some details about your app.

If your question is simply: on a screen of width $w and height $h and a centered window of 80x25, how wide is my left and top margin (or bottom?), the following should be helpful:

$left = ($w - 80) / 2; $top = ($h - 25) / 2;

which both might be negative on a small screen.

Replies are listed 'Best First'.
Re^2: Center curses output
by 2teez (Vicar) on Jul 04, 2013 at 06:38 UTC

    Hi hdb,
    ..which both might be negative on a small screen...

    easy maths?! Huh!!!
    I remembered my programming days with V.B 6.0.. Nice one bro..
    Update:
    hdb, am not undermining your point, am only emphasizing it...

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

      As I said, for a useful answer, more details might be needed...