Home Download Buy Blog Forum Support

Can't get dialog: sublime.questionBox to work

Can't get dialog: sublime.questionBox to work

Postby mrmccormack on Thu Aug 22, 2013 4:13 pm

I can't get sublime.questionBox to run in ST2, or ST3

Any idea what is wrong?

~ Thanks.
~~Rob

I tried:
Code: Select all
        sublime.question_box("hi") # doesn't work...

Example, running this at Python console

( sublime.message_dialog("Hello World!") # works fine)

view.run_command("message_dialog")


Code: Select all
import sublime
import sublime_plugin

#  run this with at the Python console with:
#  view.run_command("message_dialog")


class MessageDialogCommand(sublime_plugin.TextCommand):
    """ presents a dialog box, with only a OK button """

    def run(self, edit):
        sublime.message_dialog("Hello World!")
        sublime.questionBox("hi")



Ref:
http://www.sublimetext.com/docs/api-reference

questionBox(string) bool Displays a yes / no message box to the user, return True iff they selected yes.


Error:
Code: Select all
  File "./tp_message_dialog.py", line 13, in run
    sublime.questionBox("hi")
AttributeError: 'module' object has no attribute 'questionBox'


Path on Mac
Code: Select all
/Users/RAM_iMac/Library/Application Support/Sublime Text 2/Packages/User/tp_message_dialog.py
mrmccormack
 
Posts: 18
Joined: Wed Jul 17, 2013 4:28 pm

Re: Can't get dialog: sublime.questionBox to work

Postby mrmccormack on Thu Aug 22, 2013 4:16 pm

I see it is doesn't appear in ST3 docs.
https://www.sublimetext.com/docs/3/api_reference.html
mrmccormack
 
Posts: 18
Joined: Wed Jul 17, 2013 4:28 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 14 guests