Lostgallifreyan <z.c...@...> writes:

> But now try this. :)
> 
> frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, '')
> sc = wx.wxSpinCtrl(frame,1,"",wx.wxPoint(2,2),wx.wxSize
(60,20),wx.wxSP_ARROW_KEYS+wx.wxTE_PROCESS_ENTER,0,10,5)
> frame:Show(true)
> sc.Value = 5
> sc.Value = sc.Value .. " XYZ"
> --sc:SetValue(sc.Value .. " XYZ")
> 
> Finally, retry by moving the -- to enable the :Get variant and comment out 
the dot variant on line 5.
> The dot variant causes SpinCtrl to panic because it is trying to directly 
address the internal value, not
> the text field. TextCtrl is purely a text field, which is why the difference 
wasn't revealed.
> 
> -----------------------------------------------------------------------------
Odd but it might be explained. Look at the definition of wxSpinCtrl in 
Reference Manual. There are two versions for set.

void SetValue(const wxString& text)
void SetValue(int iValue)

If you look in wxWidgets there is only one definition namely the string 
version. I don't know why the numeric version was added in wxlua probably so 
you do not have to do SetValue(tostring(value)) for a number. This was 
probably a mistake.

Andre 


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to