GTK: wxButton appearance in wxScrolled

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Big Muscle
Experienced Solver
Experienced Solver
Posts: 54
Joined: Sun Jun 27, 2010 6:18 pm

GTK: wxButton appearance in wxScrolled

Postby Big Muscle » Fri Jan 11, 2019 9:43 am

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?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2835
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: GTK: wxButton appearance in wxScrolled

Postby ONEEYEMAN » Fri Jan 11, 2019 3:42 pm

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.

Big Muscle
Experienced Solver
Experienced Solver
Posts: 54
Joined: Sun Jun 27, 2010 6:18 pm

Re: GTK: wxButton appearance in wxScrolled

Postby Big Muscle » Mon Jan 14, 2019 7:34 am

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?

User avatar
doublemax
Moderator
Moderator
Posts: 12889
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: GTK: wxButton appearance in wxScrolled

Postby doublemax » Mon Jan 14, 2019 7:41 am

Can you show screenshots of the "good" and "bad" buttons?
Use the source, Luke!

Big Muscle
Experienced Solver
Experienced Solver
Posts: 54
Joined: Sun Jun 27, 2010 6:18 pm

Re: GTK: wxButton appearance in wxScrolled

Postby Big Muscle » Mon Jan 14, 2019 8:38 am

Sure. They are:

Good:

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


Bad:

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

User avatar
doublemax
Moderator
Moderator
Posts: 12889
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: GTK: wxButton appearance in wxScrolled

Postby doublemax » Mon Jan 14, 2019 2:39 pm

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.
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2835
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: GTK: wxButton appearance in wxScrolled

Postby ONEEYEMAN » Mon Jan 14, 2019 3:29 pm

Hi,
I presume you use GTK+2.24.
What happen if you try to upgrade to GTK+3?

Thank you.

Big Muscle
Experienced Solver
Experienced Solver
Posts: 54
Joined: Sun Jun 27, 2010 6:18 pm

Re: GTK: wxButton appearance in wxScrolled

Postby Big Muscle » Mon Jan 21, 2019 12:05 pm

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?

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2835
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: GTK: wxButton appearance in wxScrolled

Postby ONEEYEMAN » Mon Jan 21, 2019 5:28 pm

Hi,
You should rebuild wxWidgets by providing '--with-gtk=3'' and then rebuild your software.

Thank you.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 1 guest