nanogui: Thread: Understanging GrMap/GrUnmap Window


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Understanging GrMap/GrUnmap Window
From: "Robbie" ####@####.####
Date: 15 Dec 2005 22:47:15 +0000
Message-Id: <20051215224708.A8CD1BB469@xprdmailfe25.nwk.excite.com>

First let me explain what I was tring to go:
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?

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?

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?

Thanks very much.



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


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

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.