nanogui: Understanging GrMap/GrUnmap Window


Previous by date: 17 Dec 2005 20:33:36 +0000 Re: nano-x application development on x86/arm, Greg Haerr
Next by date: 17 Dec 2005 20:33:36 +0000 Re: regarding viewml, Greg Haerr
Previous in thread: 17 Dec 2005 20:33:36 +0000 Understanging GrMap/GrUnmap Window, Robbie
Next in thread:

Subject: Re: [nanogui] Understanging GrMap/GrUnmap Window
From: "Greg Haerr" ####@####.####
Date: 17 Dec 2005 20:33:36 +0000
Message-Id: <05a501c60347$f2e3bb10$6401a8c0@winXP>

: I was hoping to use one WINDOW_ID (say master_id) to display various items
on various windows (say window 1, window 2,... etc) depending on the mouse
pointer on a specified window. So Window 1 will be displayed on the
master_id and window_2 will be displayed on the same master_id at some later
time. Sometimes I do have to add another window_id on top of the master_id
(say mini_win_1) so as to have dynamic changing contents on the smaller
window.
:
: I discovered that if I Unmap the master_id, display window 2 on master_id
and remap the window, mini_id is still there. I take that to mean that if I
Unmap master_id to be reused, I have to Unmap all windows drawn on that
master_id. Is that correct?

You might want to read http://microwindows.org/Nano-XTutorial.html,
it should help you with windows, child windows, and parenting.



:
: Why do I want to do all that? Well, I thought that would save memory
becuase it appears that to Unmap a window does not remove it from memory but
simply make it invisible. Does that make sense to anyone?

A window is a data structure contained only in the server that contains
x,y,w,h,
and parent/child info.  It does not contain any window graphical
information.
The window graphical information must always be redrawn when the server
sends an EXPOSE event.  The server doesn't keep track of any window
contents, that's what the application processing in the expose event is for.

GrNewWindow creates the window data structure.
GrMapWindow clears the window background at the window's screen
location and sends an expose event to the application to draw the window
contents.
GrUnmapWindow  sends expose events to all windows which were
covered by the window, effectively causing it to "disappear".
GrDestroyWindow deallocates the window data structure.

Window parent/child relationships just determine who the server
should send expose events to, and what clipping region to build
so that the application cannot draw outside the window width/height.


:
: I would appreciate any input on this subject. What does Unmap really do?
: Also, can I explicitly issue an EXPOSE_EVENT? What is the purpose of
GrMapWindow by issuig an EXPOSURE event?

Hopefully the above answers these questions.

Regards,

Greg


Previous by date: 17 Dec 2005 20:33:36 +0000 Re: nano-x application development on x86/arm, Greg Haerr
Next by date: 17 Dec 2005 20:33:36 +0000 Re: regarding viewml, Greg Haerr
Previous in thread: 17 Dec 2005 20:33:36 +0000 Understanging GrMap/GrUnmap Window, Robbie
Next in thread:


Powered by ezmlm-browse 0.20.