This example works in 3.2, but seems to no longer work in current master:
#include <wx/wx.h>
class MyFrame : public wxFrame
{
public:
MyFrame() : wxFrame(nullptr, wxID_ANY, "Named Colour")
{
SetSize(wxSize(400, 300));
wxPanel* mainPanel = new wxPanel(this, wxID_ANY);
mainPanel->SetBackgroundColour(wxColour("Dark Red"));
Layout();
}
};
class MyApp : public wxApp
{
public:
bool OnInit() override
{
MyFrame* frame = new MyFrame();
frame->Show();
return true;
}
};
wxIMPLEMENT_APP(MyApp);
It seems that perhaps some of the named colours got lost in the refactoring that happened in src/common/gdicmn.cpp?
3.2:
Image: Image (view on web)
3.3:
Image: Image (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This might be the culprit:
55be0ed
It seems that "DarkRed" without a space works. So previously these GTK functions accidentally made "Dark Red" work. Not sure this is worth addressing since this colour isn't really part of the wx API?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks for noticing this, I didn't realize GTK functions accepted spaces and that we don't do it any longer.
I think the best thing to do would be to just strip all spaces from the string before trying to construct a colour from it. This could be too permissive but I see no real harm from letting someone create a colour called "R E D" and it would take care of using "dark", "light", "medium", "pale" and I don't know how many others as separate words.
Do you (or anybody else) see any problem with doing this?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
For some reason, GitHub didn't link it here but I made #26795 fixing this.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()