[GRASS5] Re: [GRASSLIST:1560] Re: back ground
Markus Neteler
neteler at itc.it
Thu Oct 30 10:40:02 EST 2003
On Wed, Oct 29, 2003 at 07:20:35AM +0000, Glynn Clements wrote:
>
> Markus Neteler wrote:
>
> > > > > > > > how can i change the back ground,black to white,to viwe the maps in
> > > > > > > > GRASS 5.0.0?
> > > > > > >
> > > > > > > d.erase color=white
> > > > > >
> > > > > > Which change is necessary for GRASS 5.7 to keep the white
> > > > > > standard background when resizing the monitor?
> > > > >
> > > > > Copy Serve_Xevent.c; on line 292, change BlackPixel to WhitePixel.
> > > >
> > > > Thanks. I have subitted
> > > > if (strcmp(DEFAULT_FG_COLOR, "black"))
> > > > XSetForeground(dpy, gc, BlackPixel(dpy, scrn));
> > > > else
> > > > XSetForeground(dpy, gc, WhitePixel(dpy, scrn));
> > > >
> > > > to CVS. Now it works both for 5.3 and 5.7.
> > >
> > > For consistency, you should do this in both Graph_Set.c and
> > > Serve_Xevent.c. Graph_Set.c sets the background colour at startup,
> > > Serve_Xevent.c does it when the window is resized. Presumably you want
> > > them both to be the same, right?
> >
> > The file Graph_Set.c is not linked from 5.3 into 5.7 but
> > a slightly different version (includes new cursor definition etc
> > and the change for WhitePixel).
>
> I know. Either:
>
> a) copy Serve_Xevent.c, and revert the 5.3 version so it is consistent
> with the 5.3 version of Graph_Set.c, or:
Both done.
> b) modify the 5.3 version of Graph_Set.c so that it is consistent with
> the shared version of Serve_Xevent.c.
>
> My point is that the behaviour should be the same for both the startup
> and resize cases. Given that, currently, Serve_Xevent.c is shared
> between 5.3 and 5.7, both the 5.3 and 5.7 versions of Graph_Set.c need
> to be consistent with it.
I agree.
> > > The 5.7 version of Graph_Set.c uses WhitePixel regardless of the
> > > DEFAULT_FG_COLOR setting (line 385).
> >
> > Do you mean line 374 (5.7)? This part of the file is a bit cryptic for
> > me (from line 369 onwards):
> >
> > XSetWindowBackgroundPixmap(dpy, grwin, bkupmap);
> > XSetForeground(dpy, gc, BlackPixel(dpy, scrn)); <===== !?
> > XFillRectangle(dpy, bkupmap, gc, 0, 0, xwa.width, xwa.height);
>
> These are the lines in question; in my local copy, they look like
> this (starting at 381):
>
> /* Now create a pixmap that will contain same contents as the
> * window. It will be used to redraw from after expose events */
> bkupmap = XCreatePixmap(dpy, grwin, xwa.width, xwa.height, xwa.depth);
> XSetWindowBackgroundPixmap(dpy, grwin, bkupmap);
> XSetForeground(dpy, gc, WhitePixel(dpy, scrn));
> XFillRectangle(dpy, bkupmap, gc, 0, 0, xwa.width, xwa.height);
>
> Presumably this has been changed since I last did a "cvs update" for
> 5.7 (I haven't really been following it, so updates aren't
> particularly frequent.).
Next thing to tackle is the black background in the PNG driver.
Again I am not sure how to do that. It seems to be a change needed
in
PNG/Graph_Set.c
Markus
More information about the grass-dev
mailing list