The main window under Python can be defined as follows:
def start (self):
#self. Project = Project ("temp")
#self. Project.directory = OS.GETCWD ()
#Splash = SplashScreen (self.master)
Self.hellos = 0
Self.master.title ("Stars:space-time Analysis of Regional Systems")
Self.master.iconname ("STARS")
Self.master.bind ("<Control-q>", Self.quit)
h = self.winfo_screenheight ()
W = self.winfo_screenwidth ()
Geom = "%dx%d"% (w,h)
Self.master.geometry ("600x400+0+0")
The menu is defined as follows: (List only the menu under file, then slightly)
Self.menubar = [
(' File ', 0, # (Pull-down)
[# (' New Project ... ', 0, Self.newproject), # [menu items list]
(' Open Project ... ', 0, Self.openproject),
(' Project Summary ', 0,self.projectsummary),
' Separator ', # Add a separator
(' Save Project ... ', 0, Self.saveproject),
(' Save Project as ... ', 1, Self.saveprojectas),
' Separator ',
(' Exit <CTRL-q> ', 1, self. Quit)] # label,underline,action
),
...
The corresponding command to exit the above window
def Quit (self):
# added to deal with Shell+gui options
Self.quit
Self.master.destroy ()
Sys.exit (0)
Stars use the Tkinter basic interface of the building syntax is roughly the case
Using Python as a GIS four: Tkinter Basic interface Construction