at_yasu's blog

ロード的なことを

CocoaでPythonするためのメモ書き

まだ一部分不明瞭だけど。

from Foundation import *
from AppKit import *
import objc

class pythontestAppDelegate(NSObject):
	keyoutlet = objc.IBOutlet()
	
	@objc.IBAction
	def applicationDidFinishLaunching_(self, sender):
		NSLog("Application did finish launching.")
	
	def onkeydown_(self, sender):
		NSLog("on Key Down Event [" + sender.toString() + "]")
  • Action | Outlet のたぶん理解したところ
    1. Action の設定:@objc.IBActionの下にInterfaceBuilderで接続したアクションメソッドを書く
    2. Outlet の設定:objc.IBOutlet()で順次取得。
  • よくわからない所
    1. IBOutletで得られるOutletはどの順番?設定した順番なのかしら
    2. Actionの引数、senderのオブジェクトの型はどうなってるのかしらん