wx.SystemSettings - GTK/Win32/Python variances

S

simo

I'm trying to find the vertical scrollbar width across platforms in my
wxPython app, but am having troubles.

It seems that on Linux/wx2.4.2.4 these work:

wx.SystemSettings_GetSystemMetric(wx.SYS_VSCROLL_X)
wx.SystemSettings.GetSystemMetric(wx.SYS_VSCROLL_X)

The first is supposed to be wxPython-specific according to the docs.

Neither of these work on Windows/wx2.5.1.5, but this does:

wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X)

Note the lack of the second "System".

Also, according to something I've read, "on GTK, the scrollbar is
included in the client size, but on Windows it is not included", which
seems to be crap, from my results, it seems it's not included on
either platform. Maybe this is outdated info and it's changed in 2.4+

I seem to recall that wx.Platform was being deprecated, so how do we
do platform checks to fix the things that vary between implementations
- I don't know what wxMAC does with scrollbars/GetClientSize() !
 
P

Peter Hansen

simo said:
I seem to recall that wx.Platform was being deprecated, so how do we
do platform checks to fix the things that vary between implementations

http://www.wxpython.org/MigrationGuide.html says that you should
probably begin using wx.PlatformInfo instead. This is a tuple.
('__WXMSW__', 'wxMSW', 'ascii')

The doc mentioned says to do things like this now:

if "__WXGTK__" in wx.PlatformInfo:


It also says only "BTW, wx.Platform will probably be deprecated in the
future."

Sorry, I can't help on the scrollbar question.

-Peter
 
S

simo

Peter Hansen said:
http://www.wxpython.org/MigrationGuide.html says that you should
probably begin using wx.PlatformInfo instead. This is a tuple.

('__WXMSW__', 'wxMSW', 'ascii')

The doc mentioned says to do things like this now:

if "__WXGTK__" in wx.PlatformInfo:

Yup, found that just now - I had only looked at the wxWidgets
migration guide, didn't know there was a wxPython version too!

Anyway, I don't need the platform check now as also in the wxPy25
guide they say that we're now to use
wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) across all platforms as
they're deprecating the other forms - which seem to be aliases for
backwards compatibility.

Thanks for the help :)
 
S

simo

[snip]
Same as my Windows 2000 machine.

My RedHat9 (with Unicode) box returns ('__WXGTK__', 'wxGTK', 'ascii',
'gtk1')

[...]
wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X) across all platforms as
they're deprecating the other forms - which seem to be aliases for
backwards compatibility.

Just tested this, and it works on Linux using 2.4.2.4 and 2.5.1.5 and
WinXP/2K running 2.5.1.5
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top