# In add-on script, how to automatically rewrite string in the bottom statusbar on each edge select/deselect in edit mode

I'm trying to write my first add-on that should tell me the summary length of selected edges in edit mode if there are any. I got the part with getting selected edges and counting sum length, but what I am currently struggling to do is

1. to get add-on invoked on each edge select/deselect
2. to update the sum value to display result on the bottom statusbar (where the name of the active object, amount of vertices/edges/faces are displayed)

For the first one I guess there could be some sort of callback/delegate that I could assign for every select and deselect to be invoked, but I don't know which to use. For the second I guess (and hope) I just need to know which variable to use.

I'm using blender 2.8.71 beta if that matters. Thanks

I only answer the second one for you since it is a little bit hard to find. But it is actually very useful in many case.

## status_text_set(string)

status_text_set(text) in bpy.types.WorkSpace(ID):

classmethod status_text_set(text)

Set the status bar text, typically key shortcuts for modal operators

• Parameters: text (string) – Text, New string for the status bar, None clears the text

So we can bpy.types.WorkSpace.status_text_set("hello world") to set the status bar, cool.

Or since context got an workspace as well, use context.workspace.status_text_set("foo") will be a better idea when using in operator or function which has it own context. - @batFINGER

## Important

Clear the content by assign it a None, or it will keep showing there until next function call. You should consider clear it after you leave your operator.

• Cool could also use the instance context.workspace.status_text_set("foo") – batFINGER May 24 at 16:12
• @batFINGER Yeah, that should be better than access bpy.types. – Hikariztw May 25 at 1:05
• Thanks @Hikariztw. Unfortunately I am currently unable to use blender and check how that will work for me but I will do it to the end of the next week. Also, regarding the first question. If it is a very common question how to invoke add-on method on each edge select/deselect, could you please refer me to another SO thread or perhaps an article describing that since I failed to find a clear explanation on my own. – J. Doe May 25 at 16:14