python - wx.TextCtrl has blue outline but won't receive text in wxMac -


i have been writing printer driver backend linux , mac displays window allowing user select printer. part of process user input username , password authentication. works great on linux. however, have strange issue. when run script on osx mountain lion normal user, works fine. however, when run through cups backend (as user _lp), username , password boxes not receive text, despite being selected. part of application not generate on top of windows either.

i have searched , read how macs need .app bundle, after trying that, didn't solve issue. here loginwindow class:

class logindialog(wx.dialog):   def __init__(self, parent, id=-1, title="login",         pos=wx.defaultposition,         size=wx.size(350, 150),         style=wx.stay_on_top | wx.default_frame_style ):     wx.dialog.__init__(self, parent, id, title, pos, size, style)     wx.statictext(self, -1, 'please enter caedm username , password.',         wx.point(15,5))     wx.statictext(self, -1, 'username:', wx.point(20, 32))     wx.statictext(self, -1, 'password: ', wx.point(25, 57))     self.namebox = wx.textctrl(self, 1, 'password', wx.point(100, 30),         wx.size(170, -1))     self.passwordbox = wx.textctrl(self, 2, '', wx.point(100, 55),         wx.size(170, -1), style=wx.te_password)     self.btnok = wx.button(self, wx.id_ok, ' ok ', wx.point(60, 90),         wx.defaultsize)     self.btnok.setdefault()     self.btncancel = wx.button(self, wx.id_cancel, ' cancel ', wx.point(160, 90),         wx.defaultsize)     self.https_user = []   def https_bind(self):     val = self.showmodal()     self.setfocus()     if val == wx.id_ok:         u = self.namebox.getvalue()         p = self.passwordbox.getvalue()         #since username passed cups trash, have re-invent (authenticate against https)            try:             os.environ['requests_ca_bundle'] = resource_dir + '/cacert.pem'             cert = requests.get("https://lp.et.byu.edu/pa/submit.php", auth=(u, p) )             print cert.status_code             if ( cert.status_code == 200 ):                 self.https_user.append(u)                 self.https_user.append(p)             else:                 d = errordialog(self)                 d.settitletext("server error")                 d.setlabeltext("         username or password incorrect.")                 d.showmodal()                 self.https_bind()          except:             d = errordialog(self)             d.settitletext("server error")             d.setlabeltext("         username or password incorrect.")             d.showmodal()             self.https_bind()      if val == wx.id_cancel:         os._exit(0) 

**edit: seems python-wide error, because entire application not capturing key events. captures mouse fine, however.

i think not need .app bundle, needs run same user logged in display. security measure prevent desktop equivalent of phishing. there may way around that, such temporarily becoming user, or perhaps working through system security apis allow process full access user's display, don't know details. give search though.

another possibility split ui separate process launched in user space upon signal driver. credentials , send them driver.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -