Max and Min values in a Split Container

Is there a way of setting a minimun or maximum value in a SplitContainer?

I have a split container but if you move it too much to the right the data gets all messy. I wanna set a minimun value so the data doesn't get messy and the user movement is limited.

Any help is appreciated.

Thx!

Don’t think there are those are built in. But I guess you can add a value change script on the props.split.position parameter to check if the current value is out of bound to clamp it.

Something like this

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue and currentValue.value:
		if currentValue.value > 250:
			self.props.split.position = 250
		elif currentValue.value < 100:
			self.props.split.position = 100

Replace 100 and 250 with your min and max, probably can make those as custom parameters if you want to be able to change them easily later on.

One caveat is that props.split.position also accept % value like 50%, so you might want to add additional scripting to handle those cases

2 Likes