[wx-dev] [ wxwindows-Patches-1883904 ] wxColour::(Is)Ok fix on Cocoa (also FromString)

David Elliott dfe at tgwbd.org
Fri Feb 1 13:59:43 PST 2008


Hi guys,

I've been catching up on mailing list messages periodically and came  
across this.  As far as I can tell, the idea is for ports to move  
towards a wxObject-derived wxColour.  So it looks like adding wxCocoa  
to the list is the right thing to do here since the code has never  
used the ref-data portion of wxObject.  Did I get anything wrong?

-Dave

On Jan 31, 2008, at 4:44 PM, SourceForge.net wrote:

> Patches item #1883904, was opened at 2008-01-31 13:44
> Message generated for change (Tracker Item Submitted) made by Item  
> Submitter
> You can respond by visiting:
> https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1883904&group_id=9863
>
> Please note that this message will contain a full copy of the  
> comment thread,
> including the initial issue submission, for this request,
> not just the latest update.
> Category: Cocoa specific
> Group: bug fix
> Status: Open
> Resolution: None
> Priority: 5
> Private: No
> Submitted By: Wim Lewis (wiml)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: wxColour::(Is)Ok fix on Cocoa (also FromString)
>
> Initial Comment:
> I tried building the SVN head for the Cocoa configuration and found  
> that all lookups of named colors (e.g. "LIGHT GREY") were failing  
> with an error message, with of course the concomitant display  
> problems. The root of the problem turned out to be that  
> wxCOLOUR_IS_GDIOBJECT is defined incorrectly for Cocoa builds, so  
> that wxColour was inheriting from wxGDIObject. As a result the "ok"  
> methods were checking for whether the GDI reference m_refData was  
> valid, which it never was because the concrete wxColour subclass  
> doesn't initialize it and there's no such thing as a GDI reference  
> on Cocoa anyway.
>
> The fix is simple, to add __WXCOCOA__ to the list of symbols tested  
> when defining wxCOLOUR_IS_GDIOBJECT. On the other hand, I suspect  
> this code would be less fragile if the test were positive (if  
> defined(__WXWIN__) or whatever) rather than negative (requiring  
> every new platform to add its symbols to the list to avoid this  
> error).
>
>
>
> ----------------------------------------------------------------------
>
> You can respond by visiting:
> https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1883904&group_id=9863
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-dev-help at lists.wxwidgets.org
>





More information about the wx-dev mailing list