- void Append(const wxString& name, int red, int green, int blue) {
- // first see if the name is already there
- wxString cName = name;
- cName.MakeUpper();
- wxString cName2 = cName;
- if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
- cName2.clear();
-
- wxNode *node = self->GetFirst();
- while ( node ) {
- const wxChar *key = node->GetKeyString();
- if ( cName == key || cName2 == key ) {
- wxColour* c = (wxColour *)node->GetData();
- c->Set(red, green, blue);
- return;
- }
- node = node->GetNext();
- }
+ void AddColour(const wxString& name, wxColour* colour) {
+ // make a copy since the python one will be GC'd
+ wxColour* c = new wxColour(*colour);
+ self->AddColour(name, c);
+ }