Set the unpressed state of a SegmentedControl with NSSegmentedControlMBS

I have to be able to set the pressed appearance of a SegmentedControl from pressed to unpressed programatically. I’m using NSSegmentedControlMBS to manipulate various aspects of the SegmentedControl UI, but I can’t see a way of doing this.

Parenthetically, it can be done with a Xojo SegmentedButton, but I don’t see how to use MBS with SegmentedButton (or DesktopSegmentedButton).

You can use subviews method on the NSSegmentedControlMBS to get the sub views for the buttons.
They are NSSegmentView objects. But not sure if you can set the pressed state there easily.

It may be easier to just set selectedSegment property.

Thanks for the answer. But I’ve tried selectedSegment without success. I don’t think I’m stating the problem well.

I have an WKWebviewMBS and a segmentedControl that has two segments, right and left arrows, which are set up like this:

dim n as NSSegmentedControlMBS = me.NSSegmentedControlMBSn.imageForSegment(0) = NSImageMBS.imageNamed(“NSGoBackTemplate”)
n.imageForSegment(1) = NSImageMBS.imageNamed(“NSGoForwardTemplate”)

When the user presses and holds one of the arrows for an extended period, a popup menu appears with a list of the pages in the view history appears so one can select an arbitrary page, just like Safari. But the problem is, when a selection is made from the popup menu and the mouse released, the segmented control doesn’t get the Action event and the segment doesn’t become “unpressed” in appearance, it’s as if the mouse is still down.

I can use a right-click, of course, but I’d like this to mimic Safari. Maybe there is no way to set the status of that template to unpressed programmatically in such a situation.