else/SublimeSnippets/tkinter_geometry.sublime-snippet

28 lines
1,012 B
Text
Raw Normal View History

2019-12-10 20:45:55 +00:00
<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>