I would like to add a button and I looked at many tutorials (examples) but there are no good explanations. After many tirals, I got confused. I'm sure that the mistake is in the line that starts with row.operator because the button doesn't appear and I don't know how to link it to the function called pressedButton.
class Single_PT_Button(bpy.types.Panel):
bl_label = "amazing"
bl_idname = "Single_PT_Butto.n"
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
bl_category = 'Strip'
def draw(self, context):
layout = self.layout
layout.label(text= "Press the button")
row = layout.row() # Create a simple row.
row.operator("Single_PT_Butto.n", text= "Add Text", icon= 'OUTLINER_OB_FONT')
def pressedButton ():
print("Button is pressed")
def register():
bpy.utils.register_class(Single_PT_Button)
def unregister():
bpy.utils.unregister_class(Single_PT_Button)
if name == "main":
register()
Result:
Also, I would like to ask about one more quick info, is it possible to add it inside/under an already existing Panel like Effect Strip?


