GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

10

Click here to load reader

Transcript of GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

Page 1: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

GUI Programming with Python

Gouichi IisakaThe Company was calledCray Research Japan Co., Ltd.

Page 2: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

GUI のためのモジュール

For UNIX Tkinter: Tcl/Tk, Pwm OpenGL Interface PyGtk

For Windows Tkinter WPY WxPython: Python + wxWindow

Page 3: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

グラフィック関連モジュール

Python Image LibraryGIST: Scientific Graphic Package gdmodulevtk: Visualization Tool Kit

The Visualization ToolkitAn Object-Oriented Approach To 3D GraphicsWill Schroeder, Ken Martin, Bill Lorensen646 pages, 40 color pages, CD-ROM with software/dataISBN 0-13-954694-4Prentice Hall

Http://www.python.org/download/Contributed.html#Graphics

Page 4: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

Tkinter のサンプルコード

from Tkinter import *

class Application(Frame): def say_hi(self):

print "hi there, everyone!"

def createWidgets(self):self.QUIT = Button(self)self.QUIT["text"] = "QUIT"self.QUIT["fg"] = "red"self.QUIT["command"] = self.quitself.QUIT.pack({"side": "left"})self.hi_there = Button(self)self.hi_there["text"] = "Hello",self.hi_there["command"] = self.say_hiself.hi_there.pack({"side": "left"})

Page 5: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

Tkinter のサンプルコード(つづき)

def __init__(self, master=None):Frame.__init__(self, master)

self.pack()self.createWidgets()

app = Application()app.mainloop()

Page 6: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

Tkinter クラス一覧

Page 7: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

wxPython

wxWindows を使用多くのプラットホームで動作するGUI クラスライブラリMotif 、 Xview 、 Xt 、 Win32. WxWindows

Page 8: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

wxPython

Page 9: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

PyGtk

GTK(GIMP Tool Kit) を使用Perl インタフェースもある

Page 10: GUI Programming with Python Gouichi Iisaka The Company was called Cray Research Japan Co., Ltd.

Python での GUI

基本はグルー言語拡張して GUI クラスライブラリを使用す

る極論はライブラリ次第