Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > [ Curses::UI ] How to make application resize itself to size of terminal?

Reply
Thread Tools

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

 
 
Vlad Tepes
Guest
Posts: n/a
 
      10-12-2003
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
 
Reply With Quote
 
 
 
 
Tassilo v. Parseval
Guest
Posts: n/a
 
      10-12-2003
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$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
 
Reply With Quote
 
 
 
 
Vlad Tepes
Guest
Posts: n/a
 
      10-12-2003
* 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
 
Reply With Quote
 
Rocco Caputo
Guest
Posts: n/a
 
      10-12-2003
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 http://www.velocityreviews.com/forums/(E-Mail Removed), if you'd like your e-mail to be
tracked in the CPAN bug tracker.

--
Rocco Caputo - (E-Mail Removed) - http://poe.perl.org/
 
Reply With Quote
 
Vlad Tepes
Guest
Posts: n/a
 
      10-13-2003
* Rocco Caputo <(E-Mail Removed)> (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 (E-Mail Removed), 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
obtain element name, or attribute and value of the document name itself, and some elemnts and attributes from an ancestor or the node itself using xquery Jeff Kish XML 4 10-30-2008 05:47 PM
Need to restart ASP.NET application from within the application itself Vyacheslav Lanovets ASP .Net 2 07-27-2005 09:20 AM
How to resize all images sizes and coordinates of the images on resize browser rams.kakara@gmail.com ASP General 2 02-13-2005 09:03 AM
How to get the name of a running asp.net application from the application itself??? Bob Rock ASP .Net 2 06-14-2004 06:44 PM



Advertisments