That “cheat” does work Dave, but there are problems. The normal behavior of a checkbox is that it will 'Action" if either the checkbox OR text itself is selected. This is not particularly vital to my program, but annoying nonetheless and does not conform to POLA (Principle of least astonishment).
So I thought, being the smart person that I am . . . Aha! . . . perhaps I could invoke the mouse down event on the text label to ‘check’ the box. This idea seemed reasonable. Unfortunately when I implemented that Event Handler, the Navigator showed a gray arrow (as it should) but I could not click into it to show the Action/Event. A definite BUG.
I also tried extending the checkbox with the same caption and overlaying white text with that same caption - looked fine in the IDE but the text disappeared when mouse over - utterly absurd!
It’s important to point out that the checkbox was within a colored rectangle (reasonable), which unfortunately seems to have a habit of automatically grouping controls together without my say-so, so perhaps there’s a clue there.
In any case, I was forced to restart the whole IDE. Then the ‘mouse down’ action suddenly appeared where it should have. I was so thrown off (astonished) by this series of events that I no longer trusted what I was looking at, and therefore have reverted back to a previous saved version, lest my hours of coding be lost.
Surely no “Declares” or any other esoteric methods as put forward (in the original referred thread) are required for this seemly rather simple requirement.
Thanks Jean-Paul. I’m using Windows, and as far as I can tell MacOS seems to fair better (reliable/expected) in the IDE and also the final results ie. transparency issues etc.
Sure, there are work-arounds - I’ve done that many many times in other programming languages. Sadly these basic issues are still unresolved. I took a break from programming for the last six years, and now back into it somehow thinking that things would be better this time around.
“Canvas, Shmanvas” for all I care. I simply wanted to colour the text on a checkbox, without some convoluted foul and dirty fix.
I’m a Software Developer, not a creator of coding tools - I leave that to others who are much more qualified.
I can understand that. It used to happen to me with regularity a few major releases ago. 2016R3 seems very stable though. My habit is to close and open Xojo a few times each week. And I try to avoid cross-version development if possible.
Good call Michel, instead of a coffee or beer I decided to get a good nights sleep instead - did me the world of good
I moved the label outside of the containing rectangle (in case that was causing the problem) and added the MouseDown event handler - the event appeared in the navigator where it should be, then I moved the label back into to rectangle.
I added the code as Tanner suggested, to the MouseDown event and voila!! works perfectly.