wxPG: Value from wxColourProperty?

BlitzMax Modules Forums/Brucey's Modules/wxPG: Value from wxColourProperty?

Argh! Don't you hate it when you spend hours failing to do something and then find the answer just after you ask for help.

The solution was to use the shift operator to cast from wxVariant to wxColour. I've no idea why it wouldn't work any other way. Probably my error, but just in case it saves you any time, I ended up doing it like this :

void bmx_wxpropertygrid_getpropertyvalueascolour(wxPropertyGrid* grid, BBString* prop, int* red, int* green, int* blue) {
	wxVariant v = grid->GetPropertyValue(wxStringFromBBString(prop));
	wxColour c;
	c << v;
	*red=(int)c.Red();
	*green=(int)c.Green();
	*blue=(int)c.Blue();
}


Returning it as a color didn't work either. Again, probably just my stupidity, but I don't need a perfect solution, I only need to hack in a few extra functions.