From: | |
Date: | 01 Feb 2001 at 23:48:41 |
Subject: | Re: Can someone look at this code? |
Hello Allan
On 01-Feb-01, Allan Odgaard wrote:
> Hello Jack,
>>> The best is of course to use ObtainBestPen for all your colours to
>>> get optimal pen sharing.
>> I have used ObtainBestPen before but always after a window was opened
>> so I'm not sure how I would do this in this case. Would I open the
>> screen, loop through my color settings using ObtainBestPen and use the
>> result with LoadRGB to set the screens colors before opening the
>> window?
>
> When do you need to have the palette set? You never need to call
> LoadRGB() when you use ObtainBestPen().
Then I don't understand how the function works. I thought it
just returned a value of one pen that approximates what you
asked for? It doesn't set the value into, say, the screens
colormap AFAIK. So how/when does it change the screens
colors?
I have a config option in the program in which the user can set the
colors of things like text in a listbrowser and front/background pens
of the gadgets. If the user runs the program and saves these
colors, they should be set before a window is opened the next time
the program is ran. Otherwise the window may open with one set
of colors and then change shortly after to the users. Obviously not
the way to go.
> Either you call ObtainBestPen() after opening the screen, if you have
> some colours you'd like to have set for the screen (but why? -- perhaps
> because you want to give the screen a background image?) or you let
> each window call ObtainBestPen() after opening, to allocate the colours
> required for the window (the way to go).
Maybe I don't understand what you are telling me but it sounds like doing
it the second way (let each window...after opening) will give the
problem I mentioned above. The reason I would want the screens colors
set first is because that's where the windows get their colors from, at
least that is my understanding of the way it works. Using ObtainBestPen
may work (may even be the best approach) but since everything works
fine without the SA_SharePens tag, I would assume the mechanism for
setting the colors is already built into the OS. Aren't I just causing
myself
more work by using that function?
Jack
------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/981072508/
---------------------------------------------------------------------_->