How to place panel on top of toolshelf?

Hi, how to place a panel on top of the toolshelf? I mean a custom panel added with an addon. Just like in the pic below. I know it can be done by hand, I would like to do this with code.


Problem is the panels are displayed in the order that they are loaded, starting with the ui startup scripts, I don’t think there is a command available to force the panel to load first, course you could write it into the startup scripts as the first one.

It might be possible if you look at the existing GUI code and check out the registration section (typically at the bottom of the code.) My first thought is that if you actually unregister the official panels found in the GUI code then register your panel first, followed by a re-registering of the official panel tools it might work.

@Atom Hm, sounds nice, although it can probably cause problems when changes to panels are made by devs…

if you use your addon all the time,
enable it then arrange the toolshelf how you like.
then press ctrl/u to save your default toolshelf layout in the start up file.

@@Meta-Androcto