wx.tree

99 views
Skip to first unread message

Nathan smith

unread,
Oct 21, 2019, 7:46:11 AM10/21/19
to wxpytho...@googlegroups.com
Hi there,

I'm recently working with wx.treeCtrl, and feel like I am missing
something obvious.

I'd like users to be able to tab out of the tree view, has I have a
number of buttons on the screen, and my users can not use the mouse.

Unfortunately, the styles I am using are not allowing this.

I've tried binding an event_char to the tree view but to little effect.

Am I missing a style?

Is there a work around?

Thanks

Nathan

Tim Roberts

unread,
Oct 21, 2019, 1:22:54 PM10/21/19
to wxpytho...@googlegroups.com
Nathan smith wrote:
>
> I'm recently working with wx.treeCtrl, and feel like I am missing
> something obvious.
> I'd like users to be able to tab out of the tree view, has I have a
> number of buttons on the screen, and my users can not use the mouse.
> Unfortunately, the styles I am using are not allowing this.

Are you able to tab between other controls?  What I'm wondering is, is
this specific to the tree control, or do you have more generic tabbing
trouble?

--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.


Nathan smith

unread,
Oct 21, 2019, 7:29:07 PM10/21/19
to wxpytho...@googlegroups.com
So I figured out what the problem was.

I had:

wxTreeCtrl(self,

rather than wx.TreeCtrl(panel,

Oopsies!


I'm doing a conversion from wx.listctrl to wx.treectrl for this project,
and admit I'm stuck on these two points:

1. How do you verify an item is selected? In listctrl this would be
if(self.list.GetFocusedItem()!=-1)

But that produces an error in treectrl

and 2, how do you retrieve the focused item?

Any help appreciated.

Nathan

Tim Roberts

unread,
Oct 21, 2019, 7:47:22 PM10/21/19
to wxpytho...@googlegroups.com
Nathan smith wrote:
>
>
> I'm doing a conversion from wx.listctrl to wx.treectrl for this
> project, and admit I'm stuck on these two points:
>
> 1. How do you verify an item is selected? In listctrl this would be
> if(self.list.GetFocusedItem()!=-1)
> But that produces an error in treectrl

    if ! self.tree.GetSelection().IsOk():


> and 2, how do you retrieve the focused item?

self.tree.GetSelection().
Reply all
Reply to author
Forward
0 new messages