• 用Python作GIS之四:Tkinter基本界面的搭建


    Python下的主窗口可以定义如下:
    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")

    菜单定义如下:(仅列出File下的菜单,后略)
    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
              ),
    ...

    上面窗口退出的对应命令
    def Quit(self):
            # added to deal with shell+gui options
            self.quit
            self.master.destroy()
            sys.exit(0)

    STARS采用的Tkinter基本界面的搭建语法大致就是这样

  • 相关阅读:
    前端了解即可:postman(接口测试)的使用
    ES6——TDZ(暂时性死区)
    Centos自动安装openssh及openssl脚本并隐藏版本号
    ELK学习链接
    Centos7 中使用搭建devpi并且使用Supervisor守护进程
    ansible系列
    iperf3网络测试工具
    Centos6.9下PXE安装centos 7
    CentOS 6.9下PXE+Kickstart无人值守安装操作系统
    django学习篇
  • 原文地址:https://www.cnblogs.com/columbus2/p/4298083.html
Copyright © 2020-2023  润新知