Further, tree.GetItemFont( item ).GetBold() fails with error:
wx._core.PyAssertionError: C++ assertion "Ok()" failed at ..\..\src\msw\
font.cpp(1059) in wxFont::GetWeight(): invalid font
Bug isolated: NB. SetItemFont has not been called.
···
-----Original Message-----
From: Aaron Brady [mailto:castironpi@comcast.net]
Sent: Monday, January 14, 2008 1:14 PM
> -----Original Message-----
> From: Aaron Brady [mailto:castironpi@comcast.net]
> Sent: Monday, January 14, 2008 1:07 PM
>
> SetItemItalic fails in wx.lib.customtreectrl. Not present in demo.
>
> tree.SetItemItalic( its[1] )
Observed workaround. On Windows XP Python 2.5.1 wxPython 2.8.6.1.
font2= wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC,
wx.FONTWEIGHT_NORMAL )
tree.SetItemFont( its[1], font2 )
________________
import wx
import wx.lib.customtreectrl as CT
app= wx.PySimpleApp()
frame= wx.Frame( None )
tree= CT.CustomTreeCtrl( frame,
style= CT.TR_HAS_BUTTONS| wx.SIMPLE_BORDER| wx.TAB_TRAVERSAL|
wx.TR_FULL_ROW_HIGHLIGHT )
root= tree.AddRoot( "What" )
its= [
root,
tree.AppendItem( root, "Who" ),
tree.AppendItem( root, "When" ),
tree.AppendItem( root, "Where" )
]
font= tree.GetFont()
weight= font.GetWeight() #works
font2= tree.GetItemFont( its[1] )
weight2= font2.GetWeight() #there
tree.Expand( root )
frame.Show()
app.MainLoop()
Hi All,
this should be fixed in SVN. If somebody wants to give it a go,
please let me know if it works correctly
.
Andrea.
···
On Jan 14, 2008 8:44 PM, Andrea Gavana wrote:
Hi Aaron,
On Jan 14, 2008 8:19 PM, Aaron Brady wrote:
> > -----Original Message-----
> > From: Aaron Brady [mailto:castironpi@comcast.net]
> > Sent: Monday, January 14, 2008 1:14 PM
> >
> > > -----Original Message-----
> > > From: Aaron Brady [mailto:castironpi@comcast.net]
> > > Sent: Monday, January 14, 2008 1:07 PM
> > >
> > > SetItemItalic fails in wx.lib.customtreectrl. Not present in demo.
> > >
> > > tree.SetItemItalic( its[1] )
> >
> > Observed workaround. On Windows XP Python 2.5.1 wxPython 2.8.6.1.
> >
> > font2= wx.Font( 9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_ITALIC,
> > wx.FONTWEIGHT_NORMAL )
> > tree.SetItemFont( its[1], font2 )
>
> Further, tree.GetItemFont( item ).GetBold() fails with error:
>
> wx._core.PyAssertionError: C++ assertion "Ok()" failed at ..\..\src\msw\
> font.cpp(1059) in wxFont::GetWeight(): invalid font
>
> Bug isolated: NB. SetItemFont has not been called.
> ________________
> import wx
> import wx.lib.customtreectrl as CT
>
> app= wx.PySimpleApp()
> frame= wx.Frame( None )
> tree= CT.CustomTreeCtrl( frame,
> style= CT.TR_HAS_BUTTONS| wx.SIMPLE_BORDER| wx.TAB_TRAVERSAL|
> wx.TR_FULL_ROW_HIGHLIGHT )
>
> root= tree.AddRoot( "What" )
> its= [
> root,
> tree.AppendItem( root, "Who" ),
> tree.AppendItem( root, "When" ),
> tree.AppendItem( root, "Where" )
> ]
>
> font= tree.GetFont()
> weight= font.GetWeight() #works
> font2= tree.GetItemFont( its[1] )
> weight2= font2.GetWeight() #there
>
>
> tree.Expand( root )
> frame.Show()
> app.MainLoop()
Yes, these are a couple of bugs in CustomTreeCtrl. I'll check a fix in
wxPython SVN later. Thank you for the bug reports.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/