I getting my wires crossed on the best way to add panels to AuiManger for a plugin system. I came across OnFindManager() and EVT_AUI_FIND_MANAGER. And was pondering what use case they might have.
How and where can/do you use wx.lib.agw.aui.AuiManager.OnFindManager(event)?
When and by whom/which widget does one bind to EVT_AUI_FIND_MANAGER?
When and by whom is that event sent?
I am doing a small app with TreeCtrl showing a bunch of plugin modules. When the user activates (double clicks) the treectlr’s item of the python module it imports it and calls the modules Start() function. The module has a subclassed wx.Panel that creates its own AuiPaneInfo object.
The plugin module has a Start() function which calls app=wx.GetApp() and app.MainFrame.manager.AddPane( panel, info)
It seems to me that instead of referencing “app.MainFrame.manager” I could have the new panel post an event that it would tell a “named” aui manager to AddPane( new_panel new_panel.auipaneinfo ). It is more code but it’s more eventyish.
Hi,
I getting my wires crossed on the best way to add panels to AuiManger for a
plugin system. I came across OnFindManager() and EVT_AUI_FIND_MANAGER. And
was pondering what use case they might have.
How and where can/do you use wx.lib.agw.aui.AuiManager.OnFindManager(event)?
When and by whom/which widget does one bind to EVT_AUI_FIND_MANAGER?
When and by whom is that event sent?
I am doing a small app with TreeCtrl showing a bunch of plugin modules. When
the user activates (double clicks) the treectlr's item of the python module
it imports it and calls the modules Start() function. The module has a
subclassed wx.Panel that creates its own AuiPaneInfo object.
The plugin module has a Start() function which calls app=wx.GetApp() and
app.MainFrame.manager.AddPane( panel, info)
It seems to me that instead of referencing "app.MainFrame.manager" I could
have the new panel post an event that it would tell a "named" aui manager to
AddPane( new_panel new_panel.auipaneinfo ). It is more code but it's more
eventyish.
See here:
http://xoomer.virgilio.it/infinity77/AGW_Docs/aui.framemanager.html#aui.framemanager.GetManager
You may want to try it this way:
import wx.lib.agw.aui as aui
# Some code to build the widgets...
manager = aui.GetManager(your_window)
And report back if it works (I don't even remember if it works or not).
···
On 14 July 2012 18:44, DevPlayer wrote:
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
# ------------------------------------------------------------- #
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
# ------------------------------------------------------------- #
DevPlayer wrote:
I getting my wires crossed on the best way to add panels to AuiManger
for a plugin system. I came across OnFindManager() and
EVT_AUI_FIND_MANAGER.
Completely off topic, as I was scanning quickly through my email, my
Monday morning brain read this as "fund manager", and I briefly thought
someone had created a module to manage mutual funds in Python.
A mind is a terrible thing to waste.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
DevPlayer wrote:
I getting my wires crossed on the best way to add panels to AuiManger
for a plugin system. I came across OnFindManager() and
EVT_AUI_FIND_MANAGER.
Completely off topic, as I was scanning quickly through my email, my
Monday morning brain read this as "fund manager", and I briefly thought
someone had created a module to manage mutual funds in Python.
There might already be one, there's a module for everything 
Although if there isn't, I wouldn't ever put my hands in economic
stuff, even though Python is fun at every level.
A mind is a terrible thing to waste.
+1 from me 
···
On 16 July 2012 19:43, Tim Roberts wrote:
--
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
# ------------------------------------------------------------- #
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
# ------------------------------------------------------------- #
You may want to try it this way:
import wx.lib.agw.aui as aui
# Some code to build the widgets...
manager = aui.GetManager(your_window)
And report back if it works (I don't even remember if it works or not).
Andrea.
The aui.GetManager(win) works fine. I've viewd the framemanager.py
module and noted what appears that GetManager() gets a
TopLevelWindow() and works down the window hiearchy until it finds the
AuiManager.
My goal eventually is to dock or "group" panes together based on
filters and or categories so the user can open/grow&shrink a set of
similar windows. I'm suspecting there will be multiple AuiManagers
defined, as I'd like to be able to appear to be running multiple
instances of the app. So perhaps there will be multiple
TopLevelWindow_s_()
If I take that approach I'll have to search for the owning AuiManager
from the bottom of the window hiearchy up instead. Meaning from the
pane widget to it's parent widget, if not there then too ITs parent
widget, until the "closest upward" AuiManager is found. However this
approach may be uneccessary if I go the notebook route instead a top
level frame as a pane container.
Part of my interest in the FIND_MANAGER_EVENT itself is how I can Post
that event and who would even get that event. Obviously certain
widgets that are bound to it but anyone else too (like parent frames
or even the app object?
If I had multiple AuiManagers and one MasterManager would I override
the OnFindManager() method? Just thoughts really.
Just an FYI - Andrea is on vacation right now, so you probably won’t get an answer from him for a while.
···
On Friday, July 20, 2012 12:49:03 AM UTC-5, DevPlayer wrote:
You may want to try it this way:
import wx.lib.agw.aui as aui
Some code to build the widgets…
manager = aui.GetManager(your_window)
And report back if it works (I don’t even remember if it works or not).
Andrea.
The aui.GetManager(win) works fine. I’ve viewd the framemanager.py
module and noted what appears that GetManager() gets a
TopLevelWindow() and works down the window hiearchy until it finds the
AuiManager.
My goal eventually is to dock or “group” panes together based on
filters and or categories so the user can open/grow&shrink a set of
similar windows. I’m suspecting there will be multiple AuiManagers
defined, as I’d like to be able to appear to be running multiple
instances of the app. So perhaps there will be multiple
TopLevelWindow_s_()
If I take that approach I’ll have to search for the owning AuiManager
from the bottom of the window hiearchy up instead. Meaning from the
pane widget to it’s parent widget, if not there then too ITs parent
widget, until the “closest upward” AuiManager is found. However this
approach may be uneccessary if I go the notebook route instead a top
level frame as a pane container.
Part of my interest in the FIND_MANAGER_EVENT itself is how I can Post
that event and who would even get that event. Obviously certain
widgets that are bound to it but anyone else too (like parent frames
or even the app object?
If I had multiple AuiManagers and one MasterManager would I override
the OnFindManager() method? Just thoughts really.