Home Download Buy Blog Forum Support

Problem - Self object and on_done function

Problem - Self object and on_done function

Postby Jawbfl on Mon Sep 03, 2012 2:13 am

In this code :
Code: Select all
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

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 ?!
Jawbfl
 
Posts: 7
Joined: Thu Aug 16, 2012 4:20 pm

Re: Problem - Self object and on_done function

Postby Jawbfl on Mon Sep 03, 2012 3:16 am

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 ?
Jawbfl
 
Posts: 7
Joined: Thu Aug 16, 2012 4:20 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests