Home Download Buy Blog Forum Support

Importing tkinter

Importing tkinter

Postby jbrooksuk on Thu May 05, 2011 9:36 am

How can I get tkinter imported? It all works when I'm testing without it being loaded as a plugin.

Code: Select all
import sublime, sublime_plugin
from Tkinter import *
from tkColorChooser import askcolor

class ColorPicker(sublime_plugin.WindowCommand):
   def run(self):
      getBgColor(self)


def getBgColor(self):
   (triple, hexstr) = askColor()
   if hexstr:
      try:
         if self.window.active_view():
            self.window.active_view().run_command("insert_hex", {"hex" : hexstr})
      except ValueError:
         pass

class InsertHex(sublime_plugin.TextCommand):
    def run(self, edit, hex):
            self.view.replace(edit, region, str(hex))
jbrooksuk
 
Posts: 688
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Importing tkinter

Postby guillermooo on Thu May 05, 2011 9:43 am

Doesn't seem to be included in Sublime. Sqlite isn't there either. Probably a way of trimming down the size of the download...
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: Importing tkinter

Postby jbrooksuk on Thu May 05, 2011 10:10 am

guillermooo wrote:Doesn't seem to be included in Sublime. Sqlite isn't there either. Probably a way of trimming down the size of the download...

Damn :(

Any way we could get that in?
jbrooksuk
 
Posts: 688
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Importing tkinter

Postby jbrooksuk on Fri May 06, 2011 3:47 pm

Somebody must know?
jbrooksuk
 
Posts: 688
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Importing tkinter

Postby guillermooo on Fri May 06, 2011 4:09 pm

If it doesn't have any other dependencies ---which I don't know---, copy the whole Tkinter package from any Python installation to Packages/Somewhere and make sure to add the target dir to sys.path in your plugin.
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests

cron