From: John L. <jla...@gm...> - 2009-10-23 02:21:07
|
On Thu, Oct 22, 2009 at 3:28 AM, Michael Gerbracht <sma...@ar...> wrote: > In article <a84...@ma...>, > John Labenski <jla...@gm...> wrote: >> On Wed, Oct 21, 2009 at 9:30 AM, Michael Gerbracht <sma...@ar...> >> wrote: > > I store the data in lua anyway so this should not be a problem. Or changes > will just apply after a restart. Still I am not sure how to set the style > upon creation. I use the following code to create it: > > local tree = wx.wxTreeCtrl(this, wx.wxID_ANY,wx.wxPoint(0,0), > wx.wxSize(160,250),wx.wxTR_DEFAULT_STYLE + wx.wxTR_NO_LINES > + wx.wxTR_HIDE_ROOT + wx.wxTR_MULTIPLE + wx.wxNO_BORDER); > > The styles are separated by a "+" sign, which is not standard lua so I do not > know how to make a style optional. I tried to use a variable instead of > "wx.wxTR_NO_LINES" and set it to either nil or "wx.wxTR_LINES". Both fail. > One possibility might be to define two sets of styles, one including > "wx.wxTR_NO_LINES" and the other one not. This works if you only want to make > one style configuarable. > > Is there a better/more flexible way to define the styles? These styles are simply numeric bit masks so that adding them together is the same as using a boolean OR operator on the numbers. Instead of setting it to nil set it to 0. wx.wxTR_LINES does not exist, I think you want wx.wxTR_LINES_AT_ROOT. http://docs.wxwidgets.org/stable/wx_wxtreectrl.html#wxtreectrl Regards, John |