Feb-22-2018, 05:51 PM
I really appreciate all the help. I think I have a long way to go before I can be anywhere as confident I know as much about the way wxpython works as I do tkinter ( and that isn't much.)
Here is a bit of the script I have so far.
I get no errors but no output appears.
Here is a bit of the script I have so far.
class MouseEventFrame(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Frame and Button', size=(1210, 400)) self.panel = wx.Panel(self) row = 0 column = 0 for x in range(1,67): txt = books[x] myname = txt[0:-3] while (len(myname) < 15): myname = " " + myname while (len(myname) < 20): myname += " " self.btn = 'butt' + str(x) btn = wx.Button(self.panel, -1, myname, pos=(column, row ) ) self.Bind(wx.EVT_BUTTON, self.OnClick,btn) self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnterWindow,btn) column += 120 if column == 1200: column = 0 row += 55 def OnClick(self, event): obj = event.GetEventObject() print("You clicked %s"%obj.GetLabel()) event.Skip() def OnEnterWindow(self, event,myname): obj = event.GetEventObject() print("Success at last!%s"%obj.GetLabel()) print("Success at last! ",btn[-3:]) event.Skip() app = wx.App() frame = MouseEventFrame(parent=None, id=-1) frame.Show() app.MainLoop()The OnClick event works but the OnEnterWindow does nothing.
I get no errors but no output appears.