Subject:
Re: [nanogui] Mapping, Unmapping, and Repainting Windows
From:
Gil Glass ####@####.####
Date:
14 Feb 2006 15:18:06 +0000
Message-Id: <OFEDFFB975.BEE7C5EC-ON85257115.00533871-85257115.0053FB8F@acterna.com>
Sorry, I should have included more detail. Much earlier in the code, the
following takes place:
// Open the Nano-X server.
if ( GrOpen() < 0)
{
cerr << "It didn't work." << endl;
exit(-1);
}
width = 240;
height = 160;
// Create the new window.
windowID = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, width, height, 0,
GR_COLOR_WHITE, GR_COLOR_WHITE);
// Map (show) the window. (NOT NECESSARY???)
GrMapWindow(windowID);
<yada, yada yada...>
Then, this windowID, '1' as you point out below, is passed to a function
as the parameter "parent" which is then used in the code snippet below.
HOWEVER, you have given me a clue. It sounds like using the root window
as a parent for other windows that I wish to map and unmap is bad juju.
Shall I have another window in between the root and the window that I'm
trying to map and unmap below?
Thanks!
Gil Glass
Telecom Field Services
JDSU
Germantown, MD, USA
+1-240-404-2551
Please note new e-mail address: ####@####.#### While the Acterna
address will continue to work for a while, please begin using the JDSU
address instead.
"Greg Haerr" ####@####.####
02/13/2006 11:57 PM
Please respond to
"Greg Haerr" ####@####.####
To
####@####.#### "Gil Glass" ####@####.####
cc
Subject
Re: [nanogui] Mapping, Unmapping, and Repainting Windows
: Correct me if I'm wrong, but if I have a window (the root window), whose
: window ID is "parent", that is currently displaying and takes up the
: entire display, and I then perform the following operations:
Call your parent window "parent", because the root window
is something else (it's always id 1, and always mapped). I
presume you're not talking about the real root window.
In the code below, you never mapped your parent window in the
first place, and then mapped it again. Nano-X keeps
a map count which could get confused if your map/unmap
calls don't match up.
Regards,
Greg
:
: // Create and open a new window.
: windowID = GrNewWindow(parent, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0,
: GR_COLOR_WHITE, GR_COLOR_WHITE);
:
: // Map (show) the window.
: GrMapWindow(windowID);
:
: <draw some stuff>
:
: // Remove this window.
: GrUnmapWindow(windowID);
: GrDestroyWindow(windowID);
:
: // Redraw the parent window.
: GrMapWindow(parent);
:
: I should get my original, root window back, should I not? Well I'm not.
: Any idea of what I'm doing wrong? I'm using Nano-X version 0.91.
:
: Cheers,
: Gil Glass
: Telecom Field Services
: JDSU
: Germantown, MD, USA
: +1-240-404-2551