Page 1 of 1
ButtonImageGadget background color
Posted: Tue Jan 07, 2020 11:44 am
by Rinzwind
It seems I can't set the default background color (which is white) of the ButtonImageGadget which can clash with a white image...
Too bad SetGadgetColor(0, #PB_Gadget_BackColor, RGB(105, 105, 105)) doesn't work. Any other way?
Re: ButtonImageGadget background color
Posted: Tue Jan 07, 2020 6:36 pm
by mk-soft
Buttons not support SetGadgetColor.
See PB-Help
Re: ButtonImageGadget background color
Posted: Wed Jan 08, 2020 7:48 am
by wilbert
You can set the background color of the button cell if you disable the border
Code: Select all
Button = GadgetID(0)
Cell = CocoaMessage(0, Button, "cell")
Color = CocoaMessage(0, 0, "NSColor redColor")
CocoaMessage(0, Button, "setBordered:", #NO)
CocoaMessage(0, Cell, "setBackgroundColor:", Color)
Re: ButtonImageGadget background color
Posted: Wed Jan 08, 2020 9:27 am
by C87
Hi Rinzwind,
Try a search for these in Topic Titles Only
ButtonColor
[Module] ButtonEx (all OS)
ButtonImageGadget without bevel?
String-Button with Icon
They contain excellent help on buttons from some of the elite guys

Re: ButtonImageGadget background color
Posted: Wed Jan 08, 2020 9:33 am
by mk-soft
But the button has no visual effects anymore.
The best way is to create the button yourself with the CanvasGadget.
There are many examples for this.
Link :
viewtopic.php?f=12&t=74267