LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-06-2008, 10:19 PM   #1
john.daker
Member
 
Registered: Jul 2008
Posts: 33

Rep: Reputation: 15
How to dynamically change the window's layout and size in ncurses ?


Hi all
I'm writing a program within ncurses and have no idea how to dynamically change the window's dimensions

I'm using Konsole to exec the program, and when I resize the Konsole, it seems that ncurses dont change the window to fit with Konsole.

So how to dynamically change the window's dimensions ?
What's the technique?

Thanks
 
Old 11-07-2008, 09:13 AM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,053

Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
In a GUI environment, objects send messages to each other, that is, if you resize your web browser, the object displaying the text get a message from the browser frame "Hey I have changed, rebuild the text you are displaying".

If you resize Konsole, the GUI objects will get messages, but not your CLI application. Try it: do a directory listing, resize the window until a part of the text is covered and then enlarge the window again. The text is not redisplayed.

In ncurses you are able to retrieve the screen dimensions. In your program, you should continously monitor these figures, and take appropriate action when they change, that is redraw your application using these new dimensions. This require that you don't have any modal dialogs in your application, or you have to accept that no resize is being performed during display of such a dialog.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to adjust a program window's size? linx win Debian 3 07-23-2007 10:29 PM
Can I dynamically size HTML input fields? Madone_SL_5.5 Programming 2 12-06-2006 06:32 PM
what can i do for change the windowmaker's window's font? ayiiq180 Linux - Software 2 01-16-2005 06:56 PM
Dynamically change ip address on boot up carolw Linux - Newbie 2 08-05-2003 02:08 AM
change partition size dynamically kodiakmook Linux - General 3 01-07-2002 02:56 PM


All times are GMT -5. The time now is 06:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration