Skip to content
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

sized_controls set SetSizerType with 'table' style raise error. #579

Closed
jekoie opened this issue Oct 25, 2017 · 1 comment
Closed

sized_controls set SetSizerType with 'table' style raise error. #579

jekoie opened this issue Oct 25, 2017 · 1 comment

Comments

@jekoie
Copy link

jekoie commented Oct 25, 2017

import wx
import wx.lib.sized_controls as sc
app = wx.App(0)
frame = sc.SizedFrame(None, -1, 'MI')
pane = frame.GetContentsPane()
pane.SetSizerType('table', { 'cols':2, 'rows':3})

print pane
b1 = wx.Button(pane, -1, 'good')
t1 = wx.TextCtrl(pane, -1)

t2 = wx.TextCtrl(pane, -1)
b2 = wx.Button(pane, -1, 'cool')

b3 = wx.Button(pane, -1, 'cc')
t3 = wx.TextCtrl(pane, -1, 'dd')

b1.SetSizerProps(expand=True, vgrow=1)
t1.SetSizerProps(vgrow=1,expand=True)
t2.SetSizerProps( vgrow=3, expand=True)
b2.SetSizerProps(border=(['top', 'left'], 35), vgrow=1)


frame.Show()
app.MainLoop()

C:\Python27\python.exe E:/kk/main.py
<wx.lib.sized_controls.SizedPanel object at 0x05772260>
cols 2, rows 3
fixed_height 101, fixed_width 357
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\wx\lib\sized_controls.py", line 242, in RecalcSizes
item_minsize = item.GetMinSizeWithBorder()
AttributeError: 'SizerItem' object has no attribute 'GetMinSizeWithBorder'

@kollivier
Copy link
Contributor

Sorry, TableSizer was never really fully implemented, and I did not notice it was still referenced in the docs. The proper fix for this is simply to remove TableSizer, as it was a work-in-progress that I never got around to fully completing.

Try using the 'grid' sizer type instead and see if that gives you the desired results.

kollivier added a commit to kollivier/Phoenix that referenced this issue Nov 8, 2017
…ut when attempting to use it. Remove it and its references in the docs since it doesn't work and probably won't without considerable effort.
RobinD42 added a commit that referenced this issue Nov 9, 2017
Fixes #579. TableSizer was never completed and only errors out when…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants