Split Container Limiter

Hello All!

I see there's no feature of putting limit for the Split Container, where it can be designed so that the user can have split container no smaller than certain % or larger than certain %.

Is this achievable is some other way?

Thank you!

You could put a change script on the property which sets the handle back to some limiting value if it is dragged beyond the limiting value. Note that this doesn't prevent a user from dragging beyond the limit - it only places the handle of the split container back at the limit location whenever the value is re-calculated.

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue:
		current = float(currentValue.value.rstrip("%"))
		limit = self.custom.limit
		if current - limit <= 0:
			self.props.split.position = str(limit) + "%"
		elif current + limit >= 100:
			self.props.split.position = str(100 - limit) + "%"

Is this the correct implementation? I couldn't get it working in v8.1.23.

I was able to implement the event though for when 0% is reached.

The limit property in this example is understood to be in "percent". As you've supplied a value of 100, your script is going to have issues as EVERY value would be an offending value.

I think your first screenshot's if statements after the 1st if statements require to be further indented.
... At least to my knowledge Python is sensitive to it.

Thanks this worked!
I only needed the first if statement in my application because I only needed it to prevent further going below 50%.

I still couldn't get it to work in my version though.

Using the code from the latest screenshot, you should see the handle go "back" to the 10% mark if you drag it all of the way to the left (or really anywhere left of 10%). If you drag it right you will see no effect.