I have an app which uses dynamics constants for captioning the bevels and push buttons. French/German and English (US&UK) . In essence things work ok. But I am finding that the french for something can be twice as long as the english equivalent. SO I am using pushbutton.width =width where width =graphics.stringwidth(module1.kChangeTxtColour) as example) plus some padding. This method whilst working can play havoc with the sizing of the bevels etc… So I thought about segmented control but I cannot see a way to change the caption through coding therefore rendering it useless for this purpose.
Any suggestions as to how to get round this. I am sure people have encountered this before. Thanks
It’s undocumented, but Me.Items(0).Title = “Test” works just fine.
Wow…thanks Sascha, I would never have thought of that
It’s documented - go to segmented control & you’ll see that “Items” is listed
It’s an items that contains many segments - each segment can be manipulated separately
Hence the examples that show this on
Things like this, an undocumented property “Title”, really should be in the documentation.
LIke here ?
Its mentioned right where the first example is explained that
The loop creates an instance of a SegmentedControlItem for each segment, tests whether it is selected using the Selected property, and then increases the width for only the selected ones.
and segmentedcontrol item is clickable
Does not help with relabelling the caption which is the fundamental issue! If you can’t relabel the caption all the fancy resizing is totally meaningless. Xojo does not seem to cater for hobbyist or semi-pro which is disappointing
The example is just one example of what you can do with one property of a SegmentedControlItem.
Change “size” for “title” and you can change what ever property you want in whatever way you might dream up.
We don’t write example for 100% of the possible things you can imagine as then the only thing we’d ever do is write examples.
If you’d said that in the first place then I would have understood but you merely pointed me in a direction that I had read but did not realise you could do what you said… Rather assumed these boards were for help rather than being patronised… Sorry won’t won’t ask for help again…silly me
I’m just pointing out that Sasha saying “its not documented” is not correct.
And trying to point you to where to look.
You’ll find you get more help if you can say “Hey I tried this & this & this & this and it’s not working for me”
Experiment & poke around
It would be helpfull if Xojo’s autocomplete would be more reliable.
In our current case, “Me.Items(0).” does not trigger an autocomplete and if you do not know better, you won’t find out yourself soon, that you can change various segmentedcontrol propertys this way.
And Nick please, Norman was just trying to be helpfull and he’s right by saying that they can’t write examples for each possible use case.