Bring a group of objects to the front

11OLSEN's icon

Hi, when I select multiple objects and do "bring to front" from the right-click menu, Max brings the objects to the front and preserves the inner z-order of the group of objects. How can I do the same in js ?
If I "bring to front" every single object of the selection, I would need some knowledge about the z-order before.

11OLSEN's icon

No problem, the objects in the patcher are already sorted according to z-order. I can simply use this.patcher.apply(...)

Roman Thilenius's icon

i understand the idea behind it but i guess in most cases the programmer can care about the order himself.
see it positive: this then will also work with the traditional [thispatcher] method of background/foreground. ;)

11OLSEN's icon

I finally have some time now for the moveable ui jsui (if you remember the thread some time ago) and I noticed it's helpful if the moved group of objects is brought to the front at the begin of the drag..

Roman Thilenius's icon


i remember that and looking forward for a solution. though i personally wont go the jsui route so soon but mb the threadstarter will.

what i find interesting is that when you copy and paste a bunch of objects into another patcher window, the relative z order between them remains intact - but they always end up over the existing objects.

unlike in a layout program or html, if you know what i mean.

maybe it should be generally available somewhere (not sure if the inspector would be the right place) so that nerds like us can control it programmatically.

11OLSEN's icon

I think jsui has its right to exist, can do a lot of things that aren't possible otherwise. What is terrible is the inconsistency with bpatchers.