agw control problem; FlatImageBook

Hello
I cannot figure out what I’m doing wrong here. My tab control in a FlatImageBook (within the labelbook control) is just not displaying properly. It previously worked before the agwStyle flag transition, and while every other agw control I’ve moved over to agwStyle works fine, this one just isn’t. I’ve tried with images and without; neither is doing what it should.

Any help would be appreciated.

python 2.7
wxPython 2.8.11.0 (msw-unicode)
Win XP

FlatImageBookSample.zip (3.27 KB)

You are missing an AssignImageList and perhaps other stuff. Take a
look at the labelbook demo.

Mark

···

On Jul 7, 1:00 am, mw <m...@tangsoo.us> wrote:

Hello
I cannot figure out what I'm doing wrong here. My tab control in a
FlatImageBook (within the labelbook control) is just not displaying
properly. It previously worked before the agwStyle flag transition, and
while every other agw control I've moved over to agwStyle works fine, this
one just isn't. I've tried with images and without; neither is doing what it
should.

Any help would be appreciated.

python 2.7
wxPython 2.8.11.0 (msw-unicode)
Win XP

FlatImageBookSample.zip
4KViewDownload

thanks for the suggestion, but AssignImageList is used on line #55 of
the sample code.

With or without an imagelist I can't get it to size the tabs properly.

The official demo works...maybe because it's on a split window? I
don't know.
I just don't understand why LabelBook works fine (line #40 of my
sample code) with every available agwStyle flag while FlatImageBook
fails on even the most basic ones.

···

On Jul 6, 11:36 pm, Mark <markree...@gmail.com> wrote:

You are missing an AssignImageList and perhaps other stuff. Take a
look at the labelbook demo.

Mark

On Jul 7, 1:00 am, mw <m...@tangsoo.us> wrote:

> Hello
> I cannot figure out what I'm doing wrong here. My tab control in a
> FlatImageBook (within the labelbook control) is just not displaying
> properly. It previously worked before the agwStyle flag transition, and
> while every other agw control I've moved over to agwStyle works fine, this
> one just isn't. I've tried with images and without; neither is doing what it
> should.

> Any help would be appreciated.

> python 2.7
> wxPython 2.8.11.0 (msw-unicode)
> Win XP

> FlatImageBookSample.zip
> 4KViewDownload

The demo app works for me, but your LabelBook and FlatImageBook both
fail. Your Notebook is fine..

Mark

···

On Jul 7, 11:19 pm, m <m...@tangsoo.us> wrote:

thanks for the suggestion, but AssignImageList is used on line #55 of
the sample code.

With or without an imagelist I can't get it to size the tabs properly.

The official demo works...maybe because it's on a split window? I
don't know.
I just don't understand why LabelBook works fine (line #40 of my
sample code) with every available agwStyle flag while FlatImageBook
fails on even the most basic ones.

On Jul 6, 11:36 pm, Mark <markree...@gmail.com> wrote:

> You are missing an AssignImageList and perhaps other stuff. Take a
> look at the labelbook demo.

> Mark

> On Jul 7, 1:00 am, mw <m...@tangsoo.us> wrote:

> > Hello
> > I cannot figure out what I'm doing wrong here. My tab control in a
> > FlatImageBook (within the labelbook control) is just not displaying
> > properly. It previously worked before the agwStyle flag transition, and
> > while every other agw control I've moved over to agwStyle works fine, this
> > one just isn't. I've tried with images and without; neither is doing what it
> > should.

> > Any help would be appreciated.

> > python 2.7
> > wxPython 2.8.11.0 (msw-unicode)
> > Win XP

> > FlatImageBookSample.zip
> > 4KViewDownload

fantastic...
what version of wxPython are you using?
what OS?

···

On Jul 7, 9:10 am, Mark <markree...@gmail.com> wrote:

The demo app works for me, but your LabelBook and FlatImageBook both
fail. Your Notebook is fine..

Mark

On Jul 7, 11:19 pm, m <m...@tangsoo.us> wrote:

> thanks for the suggestion, but AssignImageList is used on line #55 of
> the sample code.

> With or without an imagelist I can't get it to size the tabs properly.

> The official demo works...maybe because it's on a split window? I
> don't know.
> I just don't understand why LabelBook works fine (line #40 of my
> sample code) with every available agwStyle flag while FlatImageBook
> fails on even the most basic ones.

> On Jul 6, 11:36 pm, Mark <markree...@gmail.com> wrote:

> > You are missing an AssignImageList and perhaps other stuff. Take a
> > look at the labelbook demo.

> > Mark

> > On Jul 7, 1:00 am, mw <m...@tangsoo.us> wrote:

> > > Hello
> > > I cannot figure out what I'm doing wrong here. My tab control in a
> > > FlatImageBook (within the labelbook control) is just not displaying
> > > properly. It previously worked before the agwStyle flag transition, and
> > > while every other agw control I've moved over to agwStyle works fine, this
> > > one just isn't. I've tried with images and without; neither is doing what it
> > > should.

> > > Any help would be appreciated.

> > > python 2.7
> > > wxPython 2.8.11.0 (msw-unicode)
> > > Win XP

> > > FlatImageBookSample.zip
> > > 4KViewDownload

The FIB is setting the min size (using SetSizeHints) of the ImageContainer based on the size of the items in the image list, but when the FIB is first created there is no image list and so it is defaulting to 16 (multiplied by 2 for the image container height). Since your tab images are much larger than that then they are getting severely cut off. So to work around the problem you need to cause that minsize to be recalculated after the image list has been assigned. Adding "self.notebook_1.SetAGWWindowStyleFlag(LB.INB_TOP)" to the end of your __init__ takes care of it in the sample.

Please create a ticket about this at trac.wxwidgets.org so Andrea will be sure to see this when he gets back and can implement a proper fix.

···

On 7/6/10 10:00 AM, mw wrote:

Hello
I cannot figure out what I'm doing wrong here. My tab control in a
FlatImageBook (within the labelbook control) is just not displaying
properly. It previously worked before the agwStyle flag transition, and
while every other agw control I've moved over to agwStyle works fine,
this one just isn't. I've tried with images and without; neither is
doing what it should.

Any help would be appreciated.

--
Robin Dunn
Software Craftsman

thank you for the help; it works!

I've created a ticket on trac here:
http://trac.wxwidgets.org/ticket/12210

thanks again.
-mark

···

On Jul 7, 2:37 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 7/6/10 10:00 AM, mw wrote:

> Hello
> I cannot figure out what I'm doing wrong here. My tab control in a
> FlatImageBook (within the labelbook control) is just not displaying
> properly. It previously worked before the agwStyle flag transition, and
> while every other agw control I've moved over to agwStyle works fine,
> this one just isn't. I've tried with images and without; neither is
> doing what it should.

> Any help would be appreciated.

The FIB is setting the min size (using SetSizeHints) of the
ImageContainer based on the size of the items in the image list, but
when the FIB is first created there is no image list and so it is
defaulting to 16 (multiplied by 2 for the image container height).
Since your tab images are much larger than that then they are getting
severely cut off. So to work around the problem you need to cause that
minsize to be recalculated after the image list has been assigned.
Adding "self.notebook_1.SetAGWWindowStyleFlag(LB.INB_TOP)" to the end of
your __init__ takes care of it in the sample.

Please create a ticket about this at trac.wxwidgets.org so Andrea will
be sure to see this when he gets back and can implement a proper fix.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org