From: Schollnick, B. <Ben...@us...> - 2004-04-06 17:35:55
|
Folks, I am running into a issue, that I am having difficulty solving. (This is my first Pythoncard application....) I have the "start" button on my application currently wired to check and validate the information given to the application... --snip-- def on_BTN_start_activity_mouseDown ( self, event): self.operation = self.components.RAD_Operation.selected self.servers = self.components.LIST_Servers.selected self.simulation = self.components.CHECK_Simulation.checked == 1 self.configfile = self.components.TXT_cfile.text if self.configfile == "" or self.servers == "": bas_wxpython.wxPython_Alert_Dialog ( wxapp = self, title="Alert!", msg_text="Please specify a configuration file and a server to process." ) # wxPython.wx.EVT_SET_FOCUS (self, return '' if not(self.configfile == "" or self.servers==""): # print self.operation # print self.servers # print self.simulation # print self.configfile cmd_line = sys.argv[0] if self.simulation: cmd_line = cmd_line + " -t" ..... ..... ..... ---snip--- But if I return the focus is still on the button for "start activity", and if you click on anything, the application will not change the focus away from the "start activity" button. So Pythoncard believes you are clicking on "start activity", and report the error again. I was thinking of using the wxPython setfocus, but that appears to be fairly complex? Any suggestions on fixing this the "right" way, or a simple way? Alternatively, anyone have any focus setting samples? I did not see any validation code on the pythoncard site, so I presume that there is not a "pythoncard" method for validation? (I might of missed it.....???) -- Benjamin |