agw.aui question, setting default layout with panes in notebooked state

Good evening...

I've had trouble getting Andrea's agw.aui to create an automatic
notebook (i'll go with this term as i've seen it before)

(I also say i'm using the latest version of agw checked out from the
SVN repo, with wxpython 2.8.10.1 for python 2.6.2)

For those who don't know, when you drop a pane onto the center of
another one it docks together in the same location and notebook tabs
are added so you can flip between the two panes, this is a very cool
feature, and I wanted to have my app started with 2 panes in this
notebook state...

poking around i see that NotebookControl, and NotebookPage are there
for setting the AuiPaneInfo attributes that determine the way the pane
is arranged ...but playing around with them I can't seem to find a
solution...

I've resorted to using LoadPerspective for now, using a perspective
that I manually made and saved...this isn't the worst solution as i'm
not making many more changes to my interface, and it does work
nicely..i'm going to allow users to save/load their own perspectives
anyways..

I'd like to suggest that it be made easier to do this...
maybe instead of AddPane, we could use an AddPanes or AddInNotebook or
something of the sort that takes a list or panes and adds them into a
notebooked pane

Does anyone know if another way to accomplish this already exists?

- Michael

Michael,

michael h wrote:

Good evening...

I've had trouble getting Andrea's agw.aui to create an automatic
notebook (i'll go with this term as i've seen it before)

(I also say i'm using the latest version of agw checked out from the
SVN repo, with wxpython 2.8.10.1 for python 2.6.2)

For those who don't know, when you drop a pane onto the center of
another one it docks together in the same location and notebook tabs
are added so you can flip between the two panes, this is a very cool
feature, and I wanted to have my app started with 2 panes in this
notebook state...

poking around i see that NotebookControl, and NotebookPage are there
for setting the AuiPaneInfo attributes that determine the way the pane
is arranged ...but playing around with them I can't seem to find a
solution...

I've resorted to using LoadPerspective for now, using a perspective
that I manually made and saved...this isn't the worst solution as i'm
not making many more changes to my interface, and it does work
nicely..i'm going to allow users to save/load their own perspectives
anyways..

I'd like to suggest that it be made easier to do this...
maybe instead of AddPane, we could use an AddPanes or AddInNotebook or
something of the sort that takes a list or panes and adds them into a
notebooked pane

Does anyone know if another way to accomplish this already exists?
  

I think using the auiNotebook to start with instead of "simple" aui panes should do what you want.

        self.nb = aui.AuiNotebook(self, style=bookStyle)
        self.nb.SetArtProvider(aui.VC8TabArt())
        self.pairsPanel = wx.Panel(self.nb, -1)
        self.emptyPanel = wx.Panel(self.nb, -1)
        self.nb.AddPage(self.pairsPanel, 'Pairs', True)
        self.nb.AddPage(self.emptyPanel, 'Empty', False)

Werner

Yes, I use the auiNotebook for my main content display....and I
considered sticking these panes on auiNotebook pages

But you no longer have the flexibility of floating the pages/re-
arranging them when they are stuck in the notebook,
although i know you can split the notebook and reorder them..

For some reason leaveing the UI as customizable as possible is
important to me...so I'll continue using loadperspective until I can
figure it out...

When I get a chance I may try to add an addpanes function to aui
myself...all the code to make it happen already exists for the case
where a pane is manually moved so it shouldn't be too big a chore..

Thanks for the input,

Michael..

···

On Sep 6, 2:44 am, werner <wbru...@free.fr> wrote:

Michael,

michael h wrote:
> Good evening...

> I've had trouble getting Andrea's agw.aui to create an automatic
> notebook (i'll go with this term as i've seen it before)

> (I also say i'm using the latest version of agw checked out from the
> SVN repo, with wxpython 2.8.10.1 for python 2.6.2)

> For those who don't know, when you drop a pane onto the center of
> another one it docks together in the same location and notebook tabs
> are added so you can flip between the two panes, this is a very cool
> feature, and I wanted to have my app started with 2 panes in this
> notebook state...

> poking around i see that NotebookControl, and NotebookPage are there
> for setting the AuiPaneInfo attributes that determine the way the pane
> is arranged ...but playing around with them I can't seem to find a
> solution...

> I've resorted to using LoadPerspective for now, using a perspective
> that I manually made and saved...this isn't the worst solution as i'm
> not making many more changes to my interface, and it does work
> nicely..i'm going to allow users to save/load their own perspectives
> anyways..

> I'd like to suggest that it be made easier to do this...
> maybe instead of AddPane, we could use an AddPanes or AddInNotebook or
> something of the sort that takes a list or panes and adds them into a
> notebooked pane

> Does anyone know if another way to accomplish this already exists?

I think using the auiNotebook to start with instead of "simple" aui
panes should do what you want.

    self\.nb = aui\.AuiNotebook\(self, style=bookStyle\)
    self\.nb\.SetArtProvider\(aui\.VC8TabArt\(\)\)
    self\.pairsPanel = wx\.Panel\(self\.nb, \-1\)
    self\.emptyPanel = wx\.Panel\(self\.nb, \-1\)
    self\.nb\.AddPage\(self\.pairsPanel, &#39;Pairs&#39;, True\)
    self\.nb\.AddPage\(self\.emptyPanel, &#39;Empty&#39;, False\)

Werner

Hi Michael,

2009/9/6 michael h:

Yes, I use the auiNotebook for my main content display....and I
considered sticking these panes on auiNotebook pages

But you no longer have the flexibility of floating the pages/re-
arranging them when they are stuck in the notebook,
although i know you can split the notebook and reorder them..

For some reason leaveing the UI as customizable as possible is
important to me...so I'll continue using loadperspective until I can
figure it out...

When I get a chance I may try to add an addpanes function to aui
myself...all the code to make it happen already exists for the case
where a pane is manually moved so it shouldn't be too big a chore..

Thanks for the input,

I'll accept any patch that may improve the AUI behaviour.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Andrea,
Sounds good...

I've added an optional target=AuiPaneInfo argument to AddPane, which
adds the pane through a new AddPane4, and everything is working as
expected. However I'd like to make sure that sufficient error handling
is in place before submitting for your review...trying to break it
will have to wait until next weekend as I need to finish the project
I'm in the middle of...

I am still undecided on whether or not this is the best way to
implement this, and thought of just adding an AddPaneTo(window,
newpane, targetpane) function, does anyone have any thoughts on this?

I'm very impressed with all the work you've done...very well
documented/laid out, it was easy for me to figure out what the
framemanger was doing and make changes...

Thanks.

- Michael

···

On Sep 6, 11:43 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

Hi Michael,

2009/9/6 michael h:

> Yes, I use the auiNotebook for my main content display....and I
> considered sticking these panes on auiNotebook pages

> But you no longer have the flexibility of floating the pages/re-
> arranging them when they are stuck in the notebook,
> although i know you can split the notebook and reorder them..

> For some reason leaveing the UI as customizable as possible is
> important to me...so I'll continue using loadperspective until I can
> figure it out...

> When I get a chance I may try to add an addpanes function to aui
> myself...all the code to make it happen already exists for the case
> where a pane is manually moved so it shouldn't be too big a chore..

> Thanks for the input,

I'll accept any patch that may improve the AUI behaviour.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."http://xoomer.alice.it/infinity77/http://thedoomedcity.blogspot.com/

Andrea,

Another note, currently when two panes are in a notebook state, close
buttons are shown and you can close the pane even though the pane
has .CloseButton(False) applied to it...I think that this should not
be happening...

- Michael

···

On Sep 6, 1:30 pm, michael h <michaelke...@gmail.com> wrote:

Andrea,
Sounds good...

I've added an optional target=AuiPaneInfo argument to AddPane, which
adds the pane through a new AddPane4, and everything is working as
expected. However I'd like to make sure that sufficient error handling
is in place before submitting for your review...trying to break it
will have to wait until next weekend as I need to finish the project
I'm in the middle of...

I am still undecided on whether or not this is the best way to
implement this, and thought of just adding an AddPaneTo(window,
newpane, targetpane) function, does anyone have any thoughts on this?

I'm very impressed with all the work you've done...very well
documented/laid out, it was easy for me to figure out what the
framemanger was doing and make changes...

Thanks.

- Michael

On Sep 6, 11:43 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

> Hi Michael,

> 2009/9/6 michael h:

> > Yes, I use the auiNotebook for my main content display....and I
> > considered sticking these panes on auiNotebook pages

> > But you no longer have the flexibility of floating the pages/re-
> > arranging them when they are stuck in the notebook,
> > although i know you can split the notebook and reorder them..

> > For some reason leaveing the UI as customizable as possible is
> > important to me...so I'll continue using loadperspective until I can
> > figure it out...

> > When I get a chance I may try to add an addpanes function to aui
> > myself...all the code to make it happen already exists for the case
> > where a pane is manually moved so it shouldn't be too big a chore..

> > Thanks for the input,

> I'll accept any patch that may improve the AUI behaviour.

> Andrea.

> "Imagination Is The Only Weapon In The War Against Reality."http://xoomer.alice.it/infinity77/http://thedoomedcity.blogspot.com/

Another potential issue discovered, resizing floating panes results
in:

Traceback (most recent call last):

  File "D:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw
\aui
\framemanager.py", line 7829, in OnSize
    self.OnMove(None)

  File "D:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw
\aui
\framemanager.py", line 8238, in OnMove
    event.Skip()

AttributeError: 'NoneType' object has no attribute 'Skip'

I can't figure out that self.OnMove(None) on line 7829 is supposed to
do anything at all...

Thinking better of it, even though i couldn't find out what exactly
that line did, i changed:

event.skip() on line 8238 to

if event:event.Skip()

While we're talking about issues in AUI, I posted this over in the dev
group a few days ago and it doesn't seem anyone responded so just to
make sure someone notices:

http://groups.google.com/group/wxPython-dev/browse_thread/thread/5b59

I figure I should be posting bug reports for agw.aui in the dev group,
is that correct or is there a bug tracker?
Thanks again.

- Michael

···

On Sep 6, 1:42 pm, michael h <michaelke...@gmail.com> wrote:

Andrea,

Another note, currently when two panes are in a notebook state, close
buttons are shown and you can close the pane even though the pane
has .CloseButton(False) applied to it...I think that this should not
be happening...

- Michael

On Sep 6, 1:30 pm, michael h <michaelke...@gmail.com> wrote:

> Andrea,
> Sounds good...

> I've added an optional target=AuiPaneInfo argument to AddPane, which
> adds the pane through a new AddPane4, and everything is working as
> expected. However I'd like to make sure that sufficient error handling
> is in place before submitting for your review...trying to break it
> will have to wait until next weekend as I need to finish the project
> I'm in the middle of...

> I am still undecided on whether or not this is the best way to
> implement this, and thought of just adding an AddPaneTo(window,
> newpane, targetpane) function, does anyone have any thoughts on this?

> I'm very impressed with all the work you've done...very well
> documented/laid out, it was easy for me to figure out what the
> framemanger was doing and make changes...

> Thanks.

> - Michael

> On Sep 6, 11:43 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

> > Hi Michael,

> > 2009/9/6 michael h:

> > > Yes, I use the auiNotebook for my main content display....and I
> > > considered sticking these panes on auiNotebook pages

> > > But you no longer have the flexibility of floating the pages/re-
> > > arranging them when they are stuck in the notebook,
> > > although i know you can split the notebook and reorder them..

> > > For some reason leaveing the UI as customizable as possible is
> > > important to me...so I'll continue using loadperspective until I can
> > > figure it out...

> > > When I get a chance I may try to add an addpanes function to aui
> > > myself...all the code to make it happen already exists for the case
> > > where a pane is manually moved so it shouldn't be too big a chore..

> > > Thanks for the input,

> > I'll accept any patch that may improve the AUI behaviour.

> > Andrea.

> > "Imagination Is The Only Weapon In The War Against Reality."http://xoomer.alice.it/infinity77/http://thedoomedcity.blogspot.com/

Hi Michael,

2009/9/6 michael h:

Another potential issue discovered, resizing floating panes results
in:

Traceback (most recent call last):

File "D:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw\aui
\framemanager.py", line 7829, in OnSize
self.OnMove(None)

File "D:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw\aui
\framemanager.py", line 8238, in OnMove
event.Skip()

AttributeError: 'NoneType' object has no attribute 'Skip'

I can't figure out that self.OnMove(None) on line 7829 is supposed to
do anything at all...so I commented it out for now

This is fixed now in SVN, thank you for the bug report.

While we're talking about issues in AUI, I posted this over in the dev
group a few days ago and it doesn't seem anyone responded so just to
make sure someone notices:

http://groups.google.com/group/wxPython-dev/browse_thread/thread/5b595f5b752e0dbb

I figure I should be posting bug reports for agw.aui in the dev group,
is that correct or is there a bug tracker?

You did it right, I didn't even notice it was agw.aui related. In the
future, if you submit a bug report, or a feature request, or (best of
all) a patch, please ensure that the Component tag is set to "AGW" and
assign it to me, so that I can filter the AGW-related issues on the
bug tracker and fix them.

Another note, currently when two panes are in a notebook state, close
buttons are drawn even though the pane has .CloseButton(False) applied
to it...I think that this should not be happening...

No, it shouldn't. I'll take a look at it as soon as I get some time. I
just came back from holidays and I have a pretty tight schedule at
work, so I'll probably be able to fix only the "easy" bugs: this is
the main reason why it would be a million times better if you (and all
other AGW users) could provide a patch for bugs and features you wish
to see implemented.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

To anyone following or interested, Andrea accepted a patch for
automatic notebook creation and it is now included in the latest
revision available in the SVN repository. There is a new demo to
display this as well. Please let me know if any of you find any
problems with it.

Thanks!

- Michael