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

27 lines
1,012 B
XML

<snippet>
<content><![CDATA[
self.windowtitle = 'Window'
self.t = tkinter.Tk()
self.t.title(self.windowtitle)
self.w = 800
self.h = 525
self.screenwidth = self.t.winfo_screenwidth()
self.screenheight = self.t.winfo_screenheight()
self.windowwidth = self.w
self.windowheight = self.h
self.windowx = (self.screenwidth-self.windowwidth) / 2
self.windowy = ((self.screenheight-self.windowheight) / 2) - 27
self.geometrystring = '%dx%d+%d+%d' % (self.windowwidth, self.windowheight, self.windowx, self.windowy)
self.t.geometry(self.geometrystring)
self.build_gui_manager()
self.t.mainloop()
]]></content>
<tabTrigger>tkgeometry</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>