ich habe mir ein kleines Fenster gebastelt, in dem drei Textfelder sind und zwei Buttons. Wenn ich in das User Textfeld den User eintrage und in das Passwort Textfeld das Passwort, sollen mir diese beiden Werte als Parameter bei Button Klick an eine andere Funktion übergeben werden.
Hier zunächst einmal mein Code:
Code: Alles auswählen
...
wx.StaticText(panel, -1, "User name:", pos=(100, 12))
txtUsr = wx.TextCtrl(panel, -1, "", pos=(160, 8), size=(179, 20))
wx.StaticText(panel, -1, "Password:", pos=(100, 40))
txtPsw = wx.TextCtrl(panel, -1, "", pos=(160, 36), size=(179, 20), style=wx.TE_PASSWORD)
wx.StaticText(panel, -1, "ADS server:", pos=(100, 68))
cmbAds = wx.ComboBox(panel, -1, "", (160, 64), (179, 20), '', wx.CB_DROPDOWN)
btnLogin = wx.Button(panel, label="OK", pos=(185, 92))
self.Bind(wx.EVT_BUTTON, self.loginADS, btnLogin)
btnClose = wx.Button(panel, label="Close", pos=(265, 92))
self.Bind(wx.EVT_BUTTON, self.onExit, btnClose)
def loginADS(self, event, user, password):
try:
usr = user
pwd = password
...
MfG
