Wednesday, May 24, 2006

wxPython calculator in 50 lines of code



11 comments:

  1. Anonymous12/6/06 18:38

    I'm usually a lurker but, with this wxPython calculator I had to change line 55:

    label = evt.GetEventObject().GetTitle()

    to:

    label = evt.GetEventObject().GetLabel()

    before it would work.

    Nice blog. Good luck with it.

    Best wishes

    Ivan

    ReplyDelete
  2. Hello Ivan,

    Thanks for being 1'st commenter of my blog :)

    evt.GetEventObject().GetTitle() works for me on wxPython 2.6.3.2.

    Maybe I should add version information in my posts...

    Miki

    ReplyDelete
  3. Anonymous16/6/06 16:13

    I seem to be using wxPython 2.6.3.3 (going by python-wxgtk2.6/CHANGES.txt) on Debian (so that's wx-2.6-gtk2-unicode). I haven't tested it on Windows yet (I'll get round to that sooner or later).

    I came across your blog as I was looking for samples of wxPython code. I'm doing a comparison of wxPython vs Tkinter+PMW.

    I like the SWIG-aspect of wxPython, although I've yet to experiment with SWIG.

    Best

    Ivan

    ReplyDelete
  4. Anonymous16/6/06 16:45

    Sorry that's 2.6.3.2. 2.6.3.3 isn't out yet. Ivan

    ReplyDelete
  5. Anonymous16/6/06 17:09

    Just tested the code on Windows (2K): it works fine with GetTitle() or GetLabel()!

    Ivan

    ReplyDelete
  6. Anonymous19/6/06 17:21

    Cool code! I'd like to borrow it for teaching purposes.

    ReplyDelete
  7. Hello Rune,

    As long as you mention my name somewhere you can borrow as much as you like :)

    Have fun,
    Miki

    ReplyDelete
  8. Anonymous20/6/06 00:31

    That's a deal! Thanks. Name and URL.

    ReplyDelete
  9. Changed the code to use GetLabel, will make it more generic.

    Thanks,
    Miki

    ReplyDelete
  10. can i borrow the code? (dont worry ill give you full credit)

    ReplyDelete
  11. This blog is very interesting and has a lot of feature articles.
    Accept my greetings

    ReplyDelete