Created
July 6, 2013 21:59
-
-
Save bitlyfied/5941445 to your computer and use it in GitHub Desktop.
Just a basic Sublime Text 2 plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class SampleCommand(sublime_plugin.TextCommand): | |
############################# | |
# Main | |
############################# | |
def run(self, edit): | |
self.edit = edit | |
self.window = sublime.active_window() | |
# first prompt | |
self.window.show_input_panel('First question', '', self.on_first_answer, None, None) | |
############################# | |
# Async Handlers | |
############################# | |
def on_first_answer(self, answer_a): | |
self.answer_a = answer_a | |
self.window.show_input_panel('Second question', '', self.on_second_answer, None, None) | |
def on_second_answer(self, answer_b): | |
self.answer_b = answer_b | |
self.window.show_input_panel('Third question', '', self.on_third_answer, None, None) | |
def on_third_answer(self, answer_c): | |
answers = self.answer_a + self.answer_b + answer_c | |
sublime.message_dialog('Your answers: ' + answers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment