nanogui: Mapping, Unmapping, and Repainting Windows


Previous by date: 14 Feb 2006 17:48:21 +0000 Re: Mapping, Unmapping...PLEASE DISREGARD DUMB RESPONSE, Gil Glass
Next by date: 14 Feb 2006 17:48:21 +0000 First Screen Update, Manav Kataria
Previous in thread: 14 Feb 2006 17:48:21 +0000 Re: Mapping, Unmapping, and Repainting Windows, Gil Glass
Next in thread:

Subject: Re: [nanogui] Mapping, Unmapping, and Repainting Windows
From: "Greg Haerr" ####@####.####
Date: 14 Feb 2006 17:48:21 +0000
Message-Id: <0e9501c6318e$d347e860$0300a8c0@RDP>

:     // 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. 

No.  windowID can't be 1, that's the window id of the root window.
Also, mapping your window is ALWAYS necessary.




: 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. 

No, that's incorrect.  Your application top-level window
will almost always be a child of the root window.  That's
why the root window is pre-created, to serve as the
"anchor" parent for all user-created windows.


: Shall I have another window in between the root and the window that I'm 
: trying to map and unmap below?

No.

I think you might be getting yourself more confused than is necessary.
The window hierarchy is very simple.  It starts with window #1,
the "root" window, which is created before you get control.  Any
windows created must use an existing window id as the 
parent to get created.  And since only the root window exists, 
you must use GR_ROOT_WINDOW_ID or 1 as the first
param.

The effect of being any "child" window is just that you're x,y is
relative to your parent, rather than screen coords, and you get clipped
to the parent.  

Regards,

Greg

Previous by date: 14 Feb 2006 17:48:21 +0000 Re: Mapping, Unmapping...PLEASE DISREGARD DUMB RESPONSE, Gil Glass
Next by date: 14 Feb 2006 17:48:21 +0000 First Screen Update, Manav Kataria
Previous in thread: 14 Feb 2006 17:48:21 +0000 Re: Mapping, Unmapping, and Repainting Windows, Gil Glass
Next in thread:


Powered by ezmlm-browse 0.20.