2006-01-01から1年間の記事一覧

部品の階層構造:tcl/tk

tcl/tk では、ドット . を頂点とする木構造を使って、部品の階層構造を表現します。これは、UNIX ファイルシステムが、ルート / を頂点とする「絶対」パスによって表現されるのと同様です。ここで .frame.no とあるのは、ルートウィンドウ . の傘下にフレー…

部品の階層構造

Tk が提供する部品の階層構造と、オプションを指定する方法を紹介します。 root = Tk() root.title("(^_^)") root.config(width=150, height=60) root.propagate(False) def happy(): print "as happy as happy can be" label = Label(root, text="Are you h…

Tkinter《1》Tk ウィンドウとイベントループ ★

‖記事一覧‖ Python.use(better, Tkinter)《Python3.1》《Previous|1/∞|Next》 Tk ウィンドウとイベントループ 《著》森こねこ《監修》小泉ひよ子とタマゴ倶楽部第1版♪2006/10/28 簡単な事例 Tk の基盤となるウィンドウとイベントループについて紹介します…

Python.use(better, Tkinter)《記事一覧》

‖記事一覧‖ Python.use(better, Tkinter)《Python3.1》 《こちらに移動中です》2007年6月24日 (日)Tkinter への誘い(いざない) 《著》森こねこ・小粒ちゃん+∞《監修》小泉ひよ子とタマゴ倶楽部第0版♪1993/11/25 ● 第1版♪2006/10/28《 前の記事|次の記…

Scala.use(better,Swing); TabbedPaneDemo

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Using Swing Components TabbedPaneDemo ☞ Java Tutorials Sample Code を Scala で再構成しました 《参考記事》 How to Use Tabbed Panes (The Java™ Tutorials > Creating a GUI With JFC/Swing…

Scala.use(better,Swing)

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Using Swing Components TreeDemo * Java Tutorials Sample Code を Scala で再構成しました 《参考記事》 How to Use Trees (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swi…

Scala.use(better,Swing)

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Using Swing Components TextDemo * Java Tutorials Sample Code を Scala で再構成しました 《参考記事》 How to Use Text Areas (The Java™ Tutorials > Creating a GUI With JFC/Swing > Usin…

Scala.use(better,Swing)

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Using Swing Components ButtonDemo * Java Tutorials Sample Code を Scala で再構成しました 《参考記事》 How to Use Buttons, Check Boxes, and Radio Buttons (The Java™ Tutorials > Creat…

CR

Canvas.create_oval def create_oval(self, *args, **kw): The Tkinter Canvas Widget ¶ create_oval 2007-01-16《22》create_oval 2002-10-03《余録》Event: mouse events Canvas.create_rectangle def create_rectangle(self, *args, **kw): 2007-01-15《2…

CO

↑TOP ↑C ↑CO ♪ column= → Grid.grid ♪ columnconfigure class Misc: # lib/python3.1/tkinter/__init__.py def grid_columnconfigure(self, index, cnf={}, **kw): columnconfigure = grid_columnconfigure The Tkinter Grid Geometry Manager ¶ grid_column…

C

↑TOP ↑C |CO| ♪ Canvas class Canvas(Widget): # lib/python3.1/tkinter/__init__.py The Tkinter Canvas Widget ¶ 8. The Canvas widget ¶ @ 2007-01-16《22》create_oval 2007-01-15《21》create_rectangle 2007-01-29《余録》itemconfigure(anchor=) 20…

Scala.use(better,Swing); DropDemo

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Drag and Drop and Data Transfer DropDemo * Java Tutorials Sample Code を Jython/Scala で再構成しました 《参考記事》 ¶ Demo - DropDemo (The Java™ Tutorials > Creating a GUI With JFC/…

Scala.use(better,Swing)

《前の記事|記事一覧|次の記事》 Scala.use(better,Swing) Writing Event Listeners Beeper * Java Tutorials Sample Code を Jython/Scala で再構成しました 《参考記事》 Introduction to Event Listeners (The Java™ Tutorials > Creating a GUI With …

Scala.use(better,Swing)

☞ こちらに移動しました (^o^)

演算 () を実現する

VDM++ での演算 () に準拠するように、メソッド VDM_Map.__getitem__ を実現します。class VDM_Map: def __getitem__(m,d): """ m(d) ; map A to B * A -> B ; ; Map apply ; yields the information value whose key is d. d must ; be in the domain of m.…

演算 comp を実現する

VDM++ での演算 comp に準拠するように、メソッド VDM_Map.comp を実現します。class VDM_Map: def comp(m1,m2): """ m1 comp m2 ; map B to C * map A to B -> map A to C ; ; Map composition ; yields the the map that is created by composing m2 ; ele…

事例:演算 comp

VDM++ での演算 comp に準拠した事例(VDM_Map.comp)を紹介します。 m1 = VDM_Map({1:"alpha",2:"beta"}) m2 = VDM_Map({"A":1,"B":2}) print ">>> %s comp %s"%(m1,m2) X = m1.comp(m2) print X; assert X == VDM_Map({"A":"alpha","B":"beta"})2つの写像…

事例:演算 ()

VDM++ での演算 () に準拠した事例(演算子 [])を紹介します。 m = VDM_Map({"A":1,"B":2,"C":3}) d = "C" print ">>> %s(%s)"%(m,d) X = m[d] print X; assert X == 3写像 m において、指定したキー d に対応する値を得るには、演算子 [] を利用します。こ…

演算 ** を実現する

VDM++ での演算 ** に準拠するように、メソッド VDM_Map.__pow__ を実現します。class VDM_Map: def __pow__(m,n): """ m ** n ; (map A to A) * nat -> map A to A ; ; Map iteration ; yields the map where m is composed with itself ; n times. n=0 yie…

事例:演算 **

VDM++ での演算 ** に準拠した事例(演算子 **)を紹介します。 m = VDM_Map({1:2,2:3,3:4,4:1}) n = 2 print ">>> %s ** %s"%(m,n) X = m ** n print X; assert X == VDM_Map({1:3,2:4,3:1,4:2})同一写像を繰り返し適用した写像を得るには、演算子 ** を利…

写像の適用

VDM++ の map 型には、写像の適用を定義できます。VDM++ では、次のように表現します。 {'A' |-> 1, 'B' |-> 2, 'C' |-> 3}('C') = 3この写像にキー 'C' を適用した値は 3 になります。ただし、指定したキーは、定義域に含まれるものとします。 {1 |-> "alph…

VDM++《19》Map に対する演算(4)

Shall_we_Agile = Java.use(better, Python) # Swing by VDM++《記事一覧》 改訂♪2008/09/14《承前》

事例:演算 <-:

VDM++ での演算 VDM_Map.domBy)を紹介します。 m = VDM_Map({"A":1,"B":2}) s = VDM_Set(["A","C"]) print ">>> %s X = m.domBy(s) print X; assert X == VDM_Map({"B":2})写像 m の定義域から集合 s の要素を削除した写像を得るには、メソッド domBy を利…

事例:演算 :->

VDM++ での演算 :-> に準拠した事例(VDM_Map.rngBy)を紹介します。 m = VDM_Map({"A":1,"B":2}) s = VDM_Set([1,3]) print ">>> %s :-> %s"%(m,s) X = m.rngBy(s) print X; assert X == VDM_Map({"B":2})写像 m の値域から集合 s の要素を削除した写像を得…

事例:演算 :>

VDM++ での演算 :> に準拠した事例(VDM_Map.rngTo)を紹介します。 m = VDM_Map({"A":1,"B":2}) s = VDM_Set([1,3]) print ">>> %s :> %s"%(s,m) X = m.rngTo(s) print X; assert X == VDM_Map({"A":1})写像 m の値域を集合 s の要素に限定した写像を得るに…

事例:演算 <:

VDM++ での演算 m = VDM_Map({"A":1,"B":2}) s = VDM_Set(["A","C"]) print ">>> %s domTo(s) print X; assert X == VDM_Map({"A":1})写像 m の定義域を集合 s の要素に限定した写像を得るには、メソッド domTo を利用します。このコードを実行すると、>>> {…

演算 :> および :-> を実現する

VDM++ での演算 :> および :-> に準拠するように、メソッド VDM_Map.rngTo/VDM_Map.rngBy を実現します。class VDM_Map: def rngTo(m,s): """ m :> s ; map A to B * set of B -> map A to B ; ; Range restricted to ; creates the map consisting of the e…

演算 <: および <-: を実現する

VDM++ での演算 class VDM_Map: def domTo(m,s): """ s map A to B ; ; Domain restricted to ; creates the map consisting of the elements in m ; whose key is in s. s need not be a subset of dom ; m. """ return VDM_Map(m._domain(dom(m).inter(s))…

定義域と値域の限定

VDM++ の map 型には、定義域および値域を限定/削除した、新たな写像を定義できます。VDM++ では、次のように表現します。 {'A', 'C'} 1, 'B' |-> 2} = {'A' |-> 1}写像 {'A' |-> 1, 'B' |-> 2} の定義域を、キー集合 {'A', 'C'} の要素に限定すると {'A' |-…