Force drawing color using a Declare

Hi group. Here’s a good one. I have a plug in control that doesn’t allow me to set its text color - is there a way using perhaps a declare to override it and force it to use a specified color?


If it doesn’t provide a graphics context then it is unlikely. The API would need to know what it is setting the colour for. It’s quite possible the plugin is setting it’s own colour internally and so would simply reset your change when it drew. Try asking the provider.

Cheers Ian - I have, it’s Bjorn. Looking unlikely as you say :frowning:

Bjorn is usually very responsive.

Looks like Christians NSDatePickerMBS control lets me do it - will just have to build a container to include the calendar element.

Happy to help.

But Björn @Björn_Eiríksson may also add such a property for you.

I am evaluating things not sure yet what will be done if anything. Issue is this control is full cross platform control and doing things in those that are just for one platform have always gone very bad in the past. Users will never understand why control can be resized or recolored on one platform but not other, and complaints will just rain in.

Cross platform development is always compromise.

1 Like

FWIW, I like that Einhugur controls are easily cross platform. MBS exposes a lot of things which has its own uses too.

If there’s a workaround of using MBS to get the custom colors, I think everyone is covered and I like the way things are.

Just my friendly 2¢ :slight_smile:

As you are writing in the macOS group, I guess a macOS declare will suffice for your purposes. If the plugin exposes a handle and it is a native one supporting custom text colors, it could be doable, depending on the control. What kind of NSView are we talking about?

The Control is not Native on macOS. So no NSView.

It’s a valid comment Tim and that’s the route I’ve taken - just historically, in the previous project I’m now redesigning (interface wise), I’d extensively used Bjorn’s DateControl which works perfectly in a vanilla environment.

Do a special version just for me :slight_smile: :wink:

Taken your NSDateControl and used that with NSView Christian - cheers.

I have not 100% ruled out making some sort of change.

But special versions make no sense. No way to maintain them. And given how Xojo changes all the time and the operating systems change all the time then trust me you do need maintenance.

1 Like