i was trying script a button in 2.8 i stared withe the templates UI panel
Pre or Append to the header.
With all panels and headers in blender you can append or prepend a draw method to them.
Test script prepends a splash screen button to topbar
import bpy def draw(self, context): self.layout.operator("wm.splash") bpy.types.TOPBAR_HT_upper_bar.prepend(draw)
To find the class to "leach" onto, with developer extras on, right click and view source. With the naming convention,
TOPBAR pretty self explanatory,
HT it's a header type. Hence using autocomplete in python console is a way to find contenders