Anyone know Python?

19 views
Skip to first unread message

damonsisk

unread,
May 16, 2015, 9:47:34 PM5/16/15
to lv...@googlegroups.com
I have code written by a Joe Marshall in England called 'Tile-O-Matic' (see http://www.cs.nott.ac.uk/~jqm/?p=527).  It was written in Python, and he was kind enough to email me the source code.  I made the few tweaks to the code that I needed and they work fine.  What does not work is code for a spin box (numeric value input box with up/down arrows) in a module (attached) that works fine in the compiled version.
Actually, there are two spin boxes; one for a horizontal distance and another for a vertical distance that the software needs as input to the user.

In particular, I am sure that the functions/methods (sorry, I'm a functional programmer and don't know proper object oriented terminology) OnWidthChange and OnHeightChange are never executed/called/used.  I think they should be executed whenever the user changes the value in either the 'height' or the 'width' spin box.

Any ideas?
patioshapeeditor.py

Eric Lathrop

unread,
May 17, 2015, 2:22:15 PM5/17/15
to lv...@googlegroups.com
You should ask people in the DerbyPy meetup: http://www.meetup.com/derbypy/
--
You received this message because you are subscribed to the Google Groups "LVL1 - Louisville's Hackerspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lvl1+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joe Ibershoff

unread,
May 17, 2015, 6:15:38 PM5/17/15
to lv...@googlegroups.com
I don't have wxPython installed, so I couldn't quickly try it out myself.  However I looked at the source and took a stab at something that may or may not help.  Code attached.

The main thing I changed is the event that's being bound for those spin controls.  You said "I think they should be executed whenever the user changes the value in either the 'height' or the 'width' spin box."  That's close, but the event you are binding there only fires when one of the arrow buttons is pressed, not when the user changes the value via direct text edit.  (See docs here and here.)  I've changed it to an event that should get fired for any type of value change.  I also made a couple probably-inconsequential changes before I spotted that.

Let me know if that helps.

Also, did the spin boxes work with the original source code you were given?  If so, seeing the code pre-tweak could help us pinpoint the problem.

 -- Joe
patioshapeeditor.py
Reply all
Reply to author
Forward
0 new messages