def hello_world(): ''' This dummy says "Hello World" in a popup. ''' from pymolplugins import pref_get foo = pref_get('hello.foo', 'default') import tkMessageBox tkMessageBox.showinfo('Hello World', 'Value of hello.foo: ' + str(foo))
def settings_dialog(): ''' Open a settings dialog (optional). If such a function is provided, show a "Settings" button for this plugin in the plugin manager. ''' from pymolplugins import pref_get, pref_set foo = pref_get('hello.foo', 'default') import tkSimpleDialog foo = tkSimpleDialog.askstring('Settings', 'New value of hello.foo', initialvalue=foo) if foo is not None: pref_set('hello.foo', foo)