[wxPython-users] LCD vs CRT Monitors Issues (!)

Andrea Gavana andrea.gavana at gmail.com
Thu Nov 1 08:38:09 PDT 2007


Hi Alexei,

On 11/1/07, Alexei Vinidiktov wrote:
> Andrea Gavana wrote:
>
> >
> > Thanks to Tim Morton, who was able to track down this CRT vs LCD
> > monitors, now FlatMenu should work correctly on both monitor types.
> > Curiously, just replacing this line:
> >
> > fnt = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
> >
> > with this line:
> >
> > fnt = wx.SystemSettings_GetFont(wx.SYS_ANSI_VAR_FONT)
> >
> > Fixed the issue. I have no idea why, but it works. I can't test it on
> > Linux, but I don't see why it shouldn't work there too...
> > Also, I have finally patched ToasterBox with the modifications sent by
> > Luca Politti. Sorry for the long absence, the worst period at work
> > should be over :-D
> >
> > As usual, you can find the updated sources here:
> >
> > http://xoomer.alice.it/infinity77/main/freeware.html
> >
>
> Does FlatMenu support unicode strings?

Yes, it should work without big problems, in theory :-D

> I tried to use a unicode string for a menu item and I got this error:
>
> Traceback (most recent call last):
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> Demo.py", line 538, in <module>
>     main()
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> Demo.py", line 532, in main
>     frame = FlatMenuDemo(None, -1)
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> Demo.py", line 145, in __init__
>     self.CreateMenu()
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> Demo.py", line 288, in CreateMenu
>     self._mb.Append(fileMenu, u"Юникод")
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> .py", line 433, in Append
>     return self.Insert(len(self._items), menu, title)
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> .py", line 1174, in Insert
>     self._items.insert(pos, MenuEntryInfo(title, menu))
>   File "C:\Documents and Settings\Alexei\Desktop\FlatMenu\FlatMenu\FlatMenu
> .py", line 296, in __init__
>     self._title = titleOrMenu._title
> AttributeError: 'unicode' object has no attribute '_title'

That's a bug in FlatMenu: on line 266, try to replace the following line:

if type(titleOrMenu) == type(""):

With this line:

if isinstance(titleOrMenu, basestring):

And it should work... I didn't test it, as I don't have the unicode
version here, but please let me know if you encounter any problem.

Thank you for the report!

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


More information about the wxpython-users mailing list