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:
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.
Is there any way that I could invoke a Win NT application in a UNIX environment?
Needed to do this to direct the output of an Win NT application to a UNIX program, and then back again. Furthermore, because there's a large amount of processing to be done, it will be great if I could do this... (1 Reply)
I was asked to display a banner on the CDE login window and I have successfully accomplished that task. This is what I did:
1) made the directory /etc/dt/config/C
2) cp /usr/dt/config/C/Xresources /etc/dt/config/C
3) I edited /etc/dt/config/C/Xresources and ensured the following lines were... (0 Replies)
I was asked to display a banner on the CDE login window and I have successfully accomplished that task. This is what I did:
1) made the directory /etc/dt/config/C
2) cp /usr/dt/config/C/Xresources /etc/dt/config/C
3) I edited /etc/dt/config/C/Xresources and ensured the following lines were... (0 Replies)
Hi,
Currently in my company, we are using Windows 2003 server and Exceed. Team from India can connect to the Windows 2003 server and start Exceed to run their UNIX application. The application is GUI based.
As you know, Windows 2003 only allows two connection at any time. so I want to... (3 Replies)
I am running Terminal (xterm) on FreeBSD and XFCE. When opening a new terminal window so that an additional tab appears, the window resizes to become taller and partially hiding behind the task bar. I noticed that Xubuntu has fixed this feature and the window does not resize when opening a second... (0 Replies)
Hi.
I am beginning with Unix C Curses Library and i would like to know if it's possible to resize my current window.
In other words, i am working with a Putty Client over my Windows system and with a telnet/ssh connection to linux. I want to build a small linux application using C Curses... (10 Replies)
Hi,
I"m trying to achieve the following:
I have a NAS which holds all my pictures, and have it mounted on my xbmc as a network share. I want to automatically synchronize my pictures (NAS -> xbmc, one direction).
But, during the synchronization I want to resize the pictures to make them... (7 Replies)
I need a command or mini scripts that can find certain type of images file recursively from the current dir with files of minimum 736 width and resize them by "736 max width, relative height" and replace the source files. I currently have GD installed but can also install Imagemagick if needed, I'm... (5 Replies)
Hi Team,
I am facing issue while using Xalan & Xerces for my application.
Below are my environment details i am using :-
Platform:- Oracle Linux 6.6
Compiler :- solarisstudio12.3 C++ compiler for Linux
Below are the versions of Xalan & Xerces source code used to build the shared object... (0 Replies)
Discussion started by: agrachirag
0 Replies
LEARN ABOUT NETBSD
resizeterm
CURSES_SCREEN(3) BSD Library Functions Manual CURSES_SCREEN(3)NAME
curses_screen, newterm, set_term, delscreen, endwin, initscr, isendwin, resizeterm, setterm -- curses terminal and screen routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
SCREEN *
newterm(char *type, FILE *outfd, FILE *infd);
SCREEN *
set_term(SCREEN *screen);
void
delscreen(SCREEN *screen);
int
endwin(void);
WINDOW *
initscr(void);
bool
isendwin(void);
int
resizeterm(int lines, int cols);
int
setterm(char *name);
extern int LINES;
extern int COLS;
DESCRIPTION
These functions initialize terminals and screens.
The newterm() function initialises the curses data structures and pointers ready for use by curses. The type argument points to a termcap(5)
capability name, or it may be NULL in which case the TERM environment variable is used. The outfd and infd are the output and input file
descriptors for the terminal. The newterm() function must only be called once per terminal.
The set_term() function can be used to switch between the screens defined by calling newterm(), a pointer to the previous screen structure
that was in use will be returned on success.
Calling delscreen() will destroy the given screen and free all allocated resources.
Calling endwin() will end the curses session and restore the saved terminal settings.
The curses session must be initialised by calling initscr() which saves the current terminal state and sets up the terminal and internal data
structures to support the curses application. This function call must be, with few exceptions, the first Curses library call made. The
exception to this rule is the newterm() call which may be called prior to initscr(). The size of the curses screen is determined by checking
the tty(4) size and then the termcap(5) entries for the terminal type. If the environment variables LINES or COLS are set, then these will
be used instead.
When either newterm() or initscr() are called, the Curses library sets up signal handlers for SIGTSTP and SIGWINCH. If a signal handler is
already installed for SIGWINCH, this will also be called when the Curses library handler is called.
The isendwin() function can be used to determine whether or not a refresh of the screen has occurred since the last call to endwin().
The size of the screen may be changed by calling resizeterm() with the updated number of lines and columns. This will resize the curses
internal data structures to accommodate the changed terminal geometry. The curscr and stdscr windows and any of their subwindows will be
resized to fit the new screen size. The application must redraw the screen after a call to resizeterm().
The setterm() function sets the terminal type for the current screen to the one passed, initialising all the curses internal data structures
with information related to the named terminal. The name argument must be a valid name or alias in the termcap(5) database for this function
to succeed.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO curses_window(3), tty(4), termcap(5), signal(7)STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD. The resizeterm() function is a ncurses extension to the Curses library and was added in NetBSD 1.6.
BSD October 24, 2007 BSD