Using Python as a GIS four: Tkinter Basic interface Construction

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.