Page 1 of 1

GTK: wxButton appearance in wxScrolled

Posted: Fri Jan 11, 2019 9:43 am
by Big Muscle
Hello,
I develop an C++ application for Raspberry PI using wxWidgets (GTK2).
When I create a button in wxPanel, it looks correctly. But if I change wxPanel to wxScrolledWindow (or wxScrolled<wxPanel>), the buttons appearance changes it - thick white border appears around it. Even if I change the button background colour, the white border stays there.

The code to reproduce is very simple:

Code: Select all

class CScreen :
   public wxScrolled<wxPanel>
{
public:
   CScreen(CMainWindow* pParent) : wxScrolled<wxPanel>(pParent) {
      wxButton* button = new wxButton(this, wxID_ANY, L"BUTTON");
      button->SetBackgroundColour(wxColour(0, 0, 255));
   }

};


The same code works correctly on Windows.

Is it some known problem or is there some solution/workaround for it?

Re: GTK: wxButton appearance in wxScrolled

Posted: Fri Jan 11, 2019 3:42 pm
by ONEEYEMAN
Hi,
Are you trying to test on Raspberri or you have an actual {VM} machine with Linux installed?
Maybe it is theme specific - which theme do you use? Did you try to change it?

Thank you.

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 14, 2019 7:34 am
by Big Muscle
Hello,
it is the real Raspberry with Raspbian 9.6 installed.
If it is the theme specific why would it influence only buttons on wxScrolledWindow and not the other buttons?

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 14, 2019 7:41 am
by doublemax
Can you show screenshots of the "good" and "bad" buttons?

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 14, 2019 8:38 am
by Big Muscle
Sure. They are:

Good:

good.jpg
good.jpg (47.93 KiB) Viewed 119 times


Bad:

bad.jpg
bad.jpg (51.79 KiB) Viewed 119 times

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 14, 2019 2:39 pm
by doublemax
Well, it's not only the white border, also the background gradient and rounded corners are gone. This looks like a theme-problem to me, but i have no idea what to do about it.

Can you try to use wxScrolledCanvas instead of wxScrolledWindow? It's a very wild guess, it really shouldn't make any difference.

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 14, 2019 3:29 pm
by ONEEYEMAN
Hi,
I presume you use GTK+2.24.
What happen if you try to upgrade to GTK+3?

Thank you.

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 21, 2019 12:05 pm
by Big Muscle
I'm not sure about GTK+3. I have no experience with it.
Is it possible to use it just by rebuilding my app only, or does it require complete wxWidgets rebuild / additional system packages?

Re: GTK: wxButton appearance in wxScrolled

Posted: Mon Jan 21, 2019 5:28 pm
by ONEEYEMAN
Hi,
You should rebuild wxWidgets by providing '--with-gtk=3'' and then rebuild your software.

Thank you.