New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change treebook treectrl size? #918

Closed
lizhenwei opened this Issue Jul 12, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@lizhenwei
Copy link

lizhenwei commented Jul 12, 2018

Operating system: windows
wxPython version:4.0.1
Stock or custom build:
Python version:2.7.14
Stock or custom build:

Description of the problem:

hello .In wxpython 2.8, if we want modify tree size. we can use

tb = wx.Treebook(parent)
tb.GetTreeCtrl().SetMinSize((250, 0))

but in Phoenix ,I not find GetTreeCtrl() ,Is there any alternative way to resize the TreeCtrl of TreeBook?

@lizhenwei lizhenwei changed the title How to change treebook treectrl size How to change treebook treectrl size? Jul 12, 2018

@mesalu

This comment has been minimized.

Copy link
Collaborator

mesalu commented Jul 12, 2018

I'm not sure if there's a new kosher way, but you can search through your treebook's immediate children to find the treectrl.

Assuming no shenanigans have occurred, it should be the first child:
tb.GetChildren()[0]

But I would probably do something like this, just in case.
[x for x in tb.GetChildren() if isinstance(x, wx.TreeCtrl)][0]
Which finds the first immediate child that's an instance of wx.TreeCtrl.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 19, 2018

Fixed by #935

@RobinD42 RobinD42 closed this Jul 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment