# Is there a way to determine the left 3D view sidebar's current width with python?

I want to display a custom menu when it will be in the left top corner of the 3D View, over the view name ("User Persp" etc).

I guess this is the long way, but if I'll also know the window location and area (already answered here How to get mouse position in a window with Python?), and mouse position, then I'll be able to calculate if the mouse is in the right spot or not.

I'm not sure if the toolbar region is always the second region (region[1]) in the bpy.types.Area.regions list, but you can always just loop through and check the type:
for region in bpy.context.area.regions:

That'll pick the first region of type TOOLS, though afaik there can be only one.