Opened 4 years ago

Closed 4 years ago

#16396 closed defect (invalid)

Colour string 'MEDIUM GREY' is used by wxWidgets, but not defined

Reported by: Henk-Jan Owned by:
Priority: normal Milestone:
Component: GUI-all Version: 3.0.1
Keywords: Cc:
Blocked By: Blocking:
Patch: no


When I run the wxHaskell sample programs in Ubuntu, I always get the debug message

  Debug: wxColour::Set - couldn't set to colour string 'MEDIUM GREY'

The wxColourDatabase does not contain the string 'MEDIUM GREY' (according to ), nor is it added in wxWidgets. But a search (in the wxWidgets source code, in Windows) reveals that the string 'MEDIUM GREY' is used several times in wxWidgets to select a colour:

>Findstr /s /c:"MEDIUM GREY" *.c *.cpp *.h 
src\common\gdicmn.cpp:        {wxT("MEDIUM GREY"), 100, 100, 100},
src\common\gdicmn.cpp:            brush = new wxBrush(wxColour(wxT("MEDIUM GREY")), wxBRUSHSTYLE_SOLID);
src\common\gdicmn.cpp:            pen = new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxPENSTYLE_SOLID);
src\generic\filectrlg.cpp:        wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") );

Change History (3)

comment:1 Changed 4 years ago by vadz

  • Status changed from new to infoneeded_new

I don't know what's going on with wxHaskell, but the very first match you show does add this colour to the colour database. Moreover, I don't see any warnings with the following patch:

  • samples/minimal/minimal.cpp

    diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp
    index 64d5356..54e717a 100644
    a b void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) 
    186186void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
     188    wxColour col("MEDIUM GREY");
    188190    wxMessageBox(wxString::Format
    189191                 (
    190192                    "Welcome to %s!\n"

So there must be something specific to wxHaskell here and unfortunately I don't know what could it be. Does it use unmodified wxWidgets sources?

comment:2 Changed 4 years ago by Henk-Jan

  • Status changed from infoneeded_new to new

wxHaskell uses unmodified wxWidgets sources. See also the wxHaskell ticket for this

comment:3 Changed 4 years ago by vadz

  • Resolution set to invalid
  • Status changed from new to closed

Sorry, I still don't see how can it be wxWidgets bug. They clearly do something wrongly in wxHaskell as the other debug messages from your report show, there is no way this should happen when properly initializing the library. Something is seriously wrong with the way things happen in wxHaskell, but I can't help you with this, sorry.

Note: See TracTickets for help on using tickets.