|
|
This function creates a new panel on top of all existing panels in the deck. Its argument is a pointer to a window.
SYNOPSIS
PANEL new_panel (window) WINDOW window; /* curses window to be associated with new panel */A pointer to the panel is returned if the panel is created; otherwise, the function returns NULL. The new_panel operation fails if there is insufficient memory or if the window pointer argument is NULL. The window whose address is passed as an argument becomes associated with the panel. The size and location of the panel are the same as that of the low-level ETI (curses) window.
To create a panel, you create a window, save the pointer to it, and use the pointer as an argument to new_panel.
WINDOW *win; PANEL *pptr;Note that the newly created panel does not automatically have any adornments such as titles or borders. If you want your panel to have them, you must call appropriate low-level ETI routines with the panel's window as the argument.win = newwin(2,6,0,3); pptr = new_panel(win); /* after execution, pptr stores pointer to new panel */
When you create a new panel, it is automatically placed on top of the panel deck. Later, when you call doupdate to adjust the visibility of all panels, the top panel is completely visible. On lower levels, a portion of a panel is visible only when no region of another panel is above it. Where two panels overlap, the higher one hides the lower. (The higher one is the newer one if neither has changed its position in the panel deck because of calls to top_panel, bottom_panel, or show_panel described below.) If the panels do not over-lap, the new panel is still logically above the old one. Their relative depth is not apparent until one of them is moved and overlaps the other.