else/SublimeSnippets/tkinter_template.sublime-snippet
2019-12-10 12:45:55 -08:00

35 lines
1 KiB
XML

<snippet>
<content><![CDATA[
import tkinter
class Application:
def __init__(self):
self.windowtitle = 'Window'
self.t = tkinter.Tk()
self.t.title(self.windowtitle)
w = 800
h = 525
screenwidth = self.t.winfo_screenwidth()
screenheight = self.t.winfo_screenheight()
windowwidth = w
windowheight = h
windowx = (screenwidth-windowwidth) / 2
windowy = ((screenheight-windowheight) / 2) - 27
self.geometrystring = '%dx%d+%d+%d' % (windowwidth, windowheight, windowx, windowy)
self.t.geometry(self.geometrystring)
self.build_gui_manager()
def build_gui_manager(self):
pass
def mainloop(self):
self.t.mainloop()
]]></content>
<tabTrigger>tktemplate</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>