The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
<curses.h> nektarios4u High Level Programming 2 11-15-2007 07:58 AM
curses.h bankpro High Level Programming 2 03-28-2006 06:54 AM
CDE loging window resize? rtoba UNIX for Advanced & Expert Users 0 02-28-2006 04:18 PM
CDE loging window resize? rtoba SUN Solaris 0 02-16-2006 12:00 PM
window 2000 professional not pinging my window 98 system. kayode Windows & DOS: Issues & Discussions 10 11-13-2003 12:12 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-16-2006
Registered User
 

Join Date: Jan 2006
Posts: 1
curses & window resize issues

I am writing a program to display a database to the screen(xterm) and want to allow the window resize signal to increase/decrease the amount data that is displayed. I have a signal handler function for catching the SIGWINCH event and calling a function to reallocate the space for the windows (stdscr and curscr) an reallocate the space for the windows.

The resize function looks something like:

Code:
//GLOBAL CONSTANTS, initialized elsewhere to the correct values
WINDOW* display;
int maxX;
int maxY;

// resize event function
void resizeHandler() {
   WINDOW*curscrOld = curscr;
   WINDOW*stdscrOld = stdscr;

   delwin(curscrOld);
   delwin(stdscrOld);
   endwin();

   display = initscr();
   getmaxyx(display, maxY, maxX);

   signal(SIGWINCH, resizeHandler);
}
The problem with the reallocation function seems to be that I put in another call to initscr(). Not every time, but frequently enough to be annoying, the program will have a segmentation fault during the call to initscr() when a resize event occurs. The reason I put in another call to initscr() was getmaxyx() was not updating the size of the windows on a resize event, I tried to just use the endwin() then a call to refresh() to reinitialize the values with no luck. Is there someplace else I can get the xterm's window size and the use some calls to newwin() to create new stdscr and curscr variables on my own? I am running on Solaris 8, thanks in advance for any help.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0