[ Curses::UI ] How to make application resize itself to size of terminal?

Discussion in 'Perl Misc' started by Vlad Tepes, Oct 12, 2003.

  1. Vlad Tepes

    Vlad Tepes Guest

    Hi all!

    I'm learning to make text-mode user interfaces with Curses::UI and
    I have trouble making my applications resize themselves if the size
    of the terminal changes. It would be great if someone could provide
    tips on what I need to do.

    --
    \/L/\D
     
    Vlad Tepes, Oct 12, 2003
    #1
    1. Advertising

  2. Also sprach Vlad Tepes:

    > I'm learning to make text-mode user interfaces with Curses::UI and
    > I have trouble making my applications resize themselves if the size
    > of the terminal changes. It would be great if someone could provide
    > tips on what I need to do.


    Back from my days when I used (n)curses from C, I remember having
    defined a signal-handler for SIGWINCH (which should be triggered upon
    resizing the terminal window). This should work likewise in Perl:

    $SIG{ WINCH } = sub {
    # do whatever is needed to refresh the screen here
    };

    I am not acquainted with Curses::UI myself, maybe you need to call
    the leave_curses() and then reset_curses() methods in this handler. In
    this case your curses object needs to be in the scope of the above
    subroutine reference. So maybe you can use a global variable for it (or
    at least a closure to restrict its scope as much as possible).

    Tassilo
    --
    $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
    pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
    $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
     
    Tassilo v. Parseval, Oct 12, 2003
    #2
    1. Advertising

  3. Vlad Tepes

    Vlad Tepes Guest

    * Tassilo v. Parseval (CCLXXXV'th day of year MMIII)

    > Also sprach Vlad Tepes:
    >
    >> I'm learning to make text-mode user interfaces with Curses::UI and
    >> I have trouble making my applications resize themselves if the size
    >> of the terminal changes. It would be great if someone could provide
    >> tips on what I need to do.

    >
    > Back from my days when I used (n)curses from C, I remember having
    > defined a signal-handler for SIGWINCH (which should be triggered upon
    > resizing the terminal window). This should work likewise in Perl:
    >
    > $SIG{ WINCH } = sub {
    > # do whatever is needed to refresh the screen here
    > };


    Thanks for the tip on SIGWINCH and leave/reset_curses. My app gets
    this signal, but I still don't know how to make the C::UI widgets
    lay out themselves on the screen according to the new terminal size.
    According to the docs this could be done by simply calling layout()
    on the root window. It doesn't work for me.







    --
    \/L/\D
     
    Vlad Tepes, Oct 12, 2003
    #3
  4. Vlad Tepes

    Rocco Caputo Guest

    On Sun, 12 Oct 2003 21:50:46 +0000 (UTC), Vlad Tepes wrote:
    >
    > Thanks for the tip on SIGWINCH and leave/reset_curses. My app gets
    > this signal, but I still don't know how to make the C::UI widgets
    > lay out themselves on the screen according to the new terminal size.
    > According to the docs this could be done by simply calling layout()
    > on the root window. It doesn't work for me.


    Have you contacted the author? He's always been very good about
    responding to mail about Curses::UI. Perhaps it's a bug nobody has
    reported yet.

    There's also , if you'd like your e-mail to be
    tracked in the CPAN bug tracker.

    --
    Rocco Caputo - - http://poe.perl.org/
     
    Rocco Caputo, Oct 12, 2003
    #4
  5. Vlad Tepes

    Vlad Tepes Guest

    * Rocco Caputo <> (CCLXXXVI'th day of year MMIII)

    [ About resizing Curses::UI applications ]

    > Have you contacted the author?


    Now I have been in contact with the maintainer of C::UI. He says
    terminal resizing isn't supported and will be hard to implement.

    Looks like I'm out of luck. <big> :-( </big>

    > There's also , if you'd like your e-mail
    > to be tracked in the CPAN bug tracker.


    If a feature is not supported then it is not a bug, or is it?

    --
    \/L/\D
     
    Vlad Tepes, Oct 13, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J Turner

    Curses, Terminal Settings

    J Turner, Aug 28, 2003, in forum: Python
    Replies:
    0
    Views:
    392
    J Turner
    Aug 28, 2003
  2. Leif B. Kristensen

    Curses and Terminal DEC

    Leif B. Kristensen, Feb 17, 2005, in forum: Python
    Replies:
    0
    Views:
    311
    Leif B. Kristensen
    Feb 17, 2005
  3. Jean-Paul Calderone
    Replies:
    2
    Views:
    439
    Joel Hedlund
    Feb 9, 2006
  4. mix
    Replies:
    4
    Views:
    1,030
    Emile van Sebille
    Oct 30, 2010
  5. Kenneth McDonald
    Replies:
    8
    Views:
    267
    James Gray
    Sep 26, 2008
Loading...

Share This Page