Window pens question

3 posts / 0 new
Last post
trixie
trixie's picture
Offline
Last seen: 5 months 16 hours ago
Joined: 2011-02-03 13:58
Window pens question

I have a custom gadget that I add to a window (created by the Window Class). The gadget needs to erase its background before it gets GM_RENDERed. It appears to me (based on experimenting) that the window class uses FORESHINEPEN (rather than BACKGROUNDPEN) for the background.

Is it really the case? Can I rely on this pen being used across various themes? I mean, will FORESHINEPEN (whatever colour it represents in a particular theme) always be used for the background?

thomas
thomas's picture
Offline
Last seen: 19 hours 19 min ago
Joined: 2011-05-16 14:23
Re: Window pens question

Actually you shouldn't care about the background pen. Just use EraseRect.

To get the proper background you should save the GA_BackFill attribute in your OM_SET method and in GM_RENDER use InstallLayerHook to install that backfill hook. Don't forget to set it back to the previous value before GM_RENDER returns.

trixie
trixie's picture
Offline
Last seen: 5 months 16 hours ago
Joined: 2011-02-03 13:58
Re: Window pens question

@thomas

Thank you, works like a charm!

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

Log in or register to post comments