Hi All,
Josh English wrote:
> I'm wasting my time fiddling with my GUI, and thought a
> CollapsiblePane would solve one problem, but it has to use a full
> sized button. Is it possible to change the look of that button? I've
> tried a few experiments, but nothing seemed to work.
> Or is the only solution to go back to the raw code and refactor it?
Or reimplement it in Python. I wouldn't mind seeing a generic version
of this widget for all platforms that looks more like the native one
does on wxGTK.
Just in case someone is still interested in this issue, I have written
a generic implementation of wx.CollapsiblePane (let's guess how it is
called... PyCollapsiblePane), which allows you to customize the
collapsible pane button. This button can be the standard wx.Button or
any of the generic implementations which live in wx.lib.buttons.
I am always open to new suggestions, as I have no idea which kind of
"features" can be added to the Python implementation (easy to hack) to
make PyCollapsiblePane more powerful.
You can find the source and the demo in the usual place:
http://xoomer.alice.it/infinity77/main/freeware.html#pycollapsiblepane
Comments, feedbacks and bug-reports are as usual extremely welcome.
wxPython rules 
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
···
On 8/8/07, Robin Dunn wrote:
Hi Josh,
I was able to add a GenBitmapTextButton with the wx.NO_BORDER option
and two png's with arrows that are changed in the OnPanelChanged
method.
It crashes when I run it through the IDE. It runs once fine, then crashes.
So does your demo. I run it through the IDE, close it, run it again, and I get :
Traceback (most recent call last):
File "C:\Documents and Settings\Josh
English\Desktop\pyCP\PyCollapsiblePaneDemo.py", line 310, in <module>
size=(600, 550))
File "C:\Documents and Settings\Josh
English\Desktop\pyCP\PyCollapsiblePaneDemo.py", line 85, in __init__
wx.Frame.__init__(self, parent, id, title, pos, size, style)
File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py",
line 497, in __init__
_windows_.Frame_swiginit(self,_windows_.new_Frame(*args, **kwargs))
PyNoAppError: The wx.App object must be created first!
I'm probably running the demo file in a way you aren't expecting us to, Andrea.
It makes me wonder if there's a really easy way to add things to the demo app.
I amo not getting the same results: the demo I uploaded works fine for
me. The wx.App *is* initialized at the beginning, so I don't know why
the IDE is complaining... I don't usually run my scripts through the
IDE but from the DOS prompt.
I have run also your app (after creating a DownArrow16.png file) and
it works fine for me: Windows XP, Python 2.5.1, wxPython 2.4.8.2
*pre-release* (not latest).
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
···
On 8/11/07, Josh English wrote:
Hi All,
It would be nice to have another style, which would be a nice default.
The GTK Expander widget (which is what is used to implement
CollapsiblePane on wxGTK) is simply a rotating triangle next to a label.
No StaticLine, no button, etc. It's very simple and clean looking.
Clicking on the triangle or the label rotates the triangle to point down
and expands the panel. Clicking again rotates the triangle to point
towards the label and collapses the panel.
Ok, I have modified my implementation of PyCollapsiblePane to include
the GTK style. The new PyCollapsiblePane adds the possibility to
change the triangle-expander dimensions or to override the expander
drawing method (OnDrawGTKExpander).
The source code and the demo can be found in the usual place:
http://xoomer.alice.it/infinity77/main/freeware.html#pycollapsiblepane
Please let me know if you find any strange behaviur or if I have
missed something in the implementation.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
···
On 8/10/07, Robin Dunn wrote: