Sublime Forum

Problem - Self object and on_done function

#1

In this code :

[code]class PersonCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.name = None
self.view.window().show_input_panel(“Name”, “”, self.on_done, None, None)
print "run: ", self.name

def on_done(self, value):
    self.name = value
    print "on_done: ", self.name

[/code]
if we enter “Jack” we will get :
run: None
on_done: Jack
Why there is such a problem and how to use the input panel as a prompt to read arguments ?!

0 Likes

#2

http://stackoverflow.com/questions/12241253/set-propriety-and-on-done-methode
I understand that the on_done is not executed immediately , so how to create multiple inputs ?

0 Likes