Functionsクラスでは、Frameクラスの変数にアクセスしたいと思います。他のクラスの変数へのアクセス方法
どうか私に教えてください。
class Functions():
def changeText():
...
...
I want to change the 'text' in the Frame class
ex)Frame.text.SetFont('change text')
あなたが関数にクラスのインスタンスを送信することにより、これを行うことができますGUI要素
class Frame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, ....)
....
....
self.text = wx.StaticText(panel, .....)
変数をグローバルにしてみましたか? –
あなたのインデントのためにこれについて確かではない、 'text'はオブジェクト属性(' self.text')かクラス属性ですか? – cdarke