nanogui: GrUnmapWindow()


Previous by date: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Aaron J. Grier
Next by date: 9 Jun 2006 07:26:34 +0100 Re: ntetris demo on eCos, llandre
Previous in thread: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Aaron J. Grier
Next in thread: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Greg Haerr

Subject: Re: [nanogui] Re: GrUnmapWindow()
From: Aveek Adhya ####@####.####
Date: 9 Jun 2006 07:26:34 +0100
Message-Id: <448916A4.7030308@rebaca.com>

No , I am not running any sort of window manager. My program is just 
like this :
#include <nano-X.h>
#include <mwtypes.h>
#include <stdio.h>
#define MARGIN 100
main()
{
GR_WINDOW_ID wid; /* window id */
GR_GC_ID gc; /* graphics context id. defined as 'unsigned int' */
GR_SCREEN_INFO si; /* screen information */

if (GrOpen() < 0) // Open a connection to the graphics driver.
{
fprintf(stderr, "Cannot open graphics\n");
exit(1);
}
GrGetScreenInfo(&si); // Fills in the specified GR_SCREEN_INFO structure.
printf("Col = %d Rows = %d\n",si.cols,si.rows);

wid = GrNewWindow(GR_ROOT_WINDOW_ID, MARGIN, MARGIN,
si.cols - MARGIN * 2, si.rows - MARGIN * 2,
4, MWRGB(255,255,0),MWRGB(0,0,255));

GrMapWindow(wid);
gc = GrNewGC();

GrLine(wid,gc,10,10,100,100);
GrFillRect(wid,gc,100,30,60,50);
// GrSetGCForeground(gc, MWRGB(200,5,5));
fprintf(stderr,"Press any key to hideeeeee window ...\n");
{ getchar(); }

GrUnmapWindow(wid);
fprintf(stderr,"Press any key to unhide window ...\n");
{ getchar(); }
GrMapWindow(wid); // can display the background again, but neither the 
rectangle nor the line
GrFlush();
return 0;
}
What I have noticed that when "GrMapWindow(wid)" is called for the 
second time (after screen become blank due to the call of 
GrUnmapWindow(wid) ),
it can display only the background but not the objects (rectangle, line 
etc).

Aaron J. Grier wrote:

>On Thu, Jun 08, 2006 at 06:12:41PM +0530, Aveek Adhya wrote:
>
>  
>
>>GrMapWindow(wid);    // to make the window visible
>>gc = GrNewGC();          //  create a new GC
>>GrFillRect(wid,gc,100,30,60,50);   // draw a rectangle on the main window
>>getchar();                                         // wait for a key press
>>GrUnmapWindow(wid);                 //  unmap the window
>>getchar();                                         // wait for a key press
>>GrMapWindow(wid);                     //  make the window visible again
>>.......
>>
>>Although the "GrUnmapWindow(wid)" can hide the window, calling 
>>"GrMapWindow(wid)" can't make the window visible again.
>>Any idea where I am doing the mistake ?  ..... or it is not at all 
>>possible with these APIs ?
>>    
>>
>
>when GrMapWindow(wid) is called, wid will be sent an expose event; it is
>then up to a handler to redraw the exposed area.
>
>are you running a window manager of any sort?
>
>  
>


Previous by date: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Aaron J. Grier
Next by date: 9 Jun 2006 07:26:34 +0100 Re: ntetris demo on eCos, llandre
Previous in thread: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Aaron J. Grier
Next in thread: 9 Jun 2006 07:26:34 +0100 Re: GrUnmapWindow(), Greg Haerr


Powered by ezmlm-browse 0.20.