Have you looked at the value returned from GetMaxSize? (Hint, -1 means
that it is undefined.)
If you're using this in a sizer then you really want to use SetMinSize
instead as that tells the sizer what the smallest best size of the
widget should be, and unless something in the sizer item flags causes it
to be larger then the minsize is the largest the sizer will make it too.
And the minsize overrides the widget's built in best size.
You can get an approximate pixel value for how wide to make the widget
by using sc.GetTextExtent('00').width + N where N is some value you pick
to add extra space for the internal margins, the size of the spin
button, etc.
--
Robin Dunn
Software Craftsman
http://wxPython.org