button back color property

Post Reply
sadams54
Posts: 14
Joined: Monday 09th July 2018 3:43am

button back color property

Post by sadams54 » Monday 09th July 2018 3:49am

I have been using gambas for couple years now. one thing bothers me. I can set color to something like a button but when I look it does not put that color on the design screen. It also does not put the color on the running program. everything is the standard grey button colors. Am I doing something wrong? I am on Fedora 28

User avatar
cogier
Site Admin
Posts: 202
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: button back color property

Post by cogier » Monday 09th July 2018 7:15am

Hi sadams and welcome to the forum.

This problem has popped up before. The first thing to try is to change the component gb.gui to gb.gtk3 and see if that does the trick for you.

Here is a little program that might help.

Image
Buttons.tar.gz
(33.92 KiB) Downloaded 56 times

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Tuesday 10th July 2018 12:06pm

It is not always good to limit an app to a certain version of a certain widgetset. If so, it should not be to hard to code a custom button component. If you are really lazy, you could perhaps even use a panel to simulate a button 8-)

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Tuesday 10th July 2018 12:08pm

You could for example look at my vertical progress bar at the Gambas farm for an easy start with component writing...

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Tuesday 10th July 2018 12:10pm

Or even this one
viewtopic.php?f=6&t=12

User avatar
cogier
Site Admin
Posts: 202
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: button back color property

Post by cogier » Tuesday 10th July 2018 3:56pm

You have a point jornmo but after some messing about I thought that a Label has everything you need so here is another solution, this time not requiring 'gb.gtk3'

Image
Colour_Button.tar.gz
(12.04 KiB) Downloaded 48 times

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Sunday 15th July 2018 2:50pm

Here's my take with a custom component. Just a humble beginning. Needs some refinement :)
mtButton-0.0.1.tar.gz
(9.51 KiB) Downloaded 44 times

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Sunday 15th July 2018 8:59pm

This was a littlebit fun :)
Here's a somewhat more refined version, but still lacking here and there. I'm struggling to get the defaults to work. You need to set Color1, Color2 and Foreground for now.
mtButton-0.0.2.tar.gz
(9.91 KiB) Downloaded 44 times

sadams54
Posts: 14
Joined: Monday 09th July 2018 3:43am

Re: button back color property

Post by sadams54 » Monday 16th July 2018 2:58am

Jornmo answered it. changing to the gtk did the trick perfectly. Not sure why the rest of the convo is going so out there....

User avatar
jornmo
Site Admin
Posts: 173
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: button back color property

Post by jornmo » Monday 16th July 2018 9:40am

Whaaaat an insult!!! :o :o :o

8-) :lol:

Btw., it was cogier who told about the GTK solution.

Post Reply