ButtonImageGadget background color

Mac OSX specific forum
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

ButtonImageGadget background color

Post 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?
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ButtonImageGadget background color

Post by mk-soft »

Buttons not support SetGadgetColor.
See PB-Help
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: ButtonImageGadget background color

Post 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)
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
C87
Enthusiast
Enthusiast
Posts: 176
Joined: Mon Jul 17, 2017 7:22 am
Location: Cotswolds England

Re: ButtonImageGadget background color

Post 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 :)
If it's falling over......just remember the computer is never wrong!
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ButtonImageGadget background color

Post 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
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply