Pheonix - Having issues resizing panel based on user action

Hello,

I am trying to port over a bit of code from wx2.8 to wxPheonix (3.0.3.dev78356 msw). I’m using code from the pyfa project (https://github.com/DarkFenX/Pyfa) which is currently being rewritten for python3. This code takes some concepts from PyCollapsiblePane and implements it better (there are some bugs with PCP). If you download and open pyfa, the collapsible panels are on the right side (resources, resistances, etc) if you want to get a feel for how it is supposed to work.

Anyway, I’m trying to port this over and I cannot seem to get it to work well. I know Pheonix introduces some changes to sizers and how things are resized. I am able to collapse the panel (and have the parent panel fit to the new size), and then open it again. But when I try to collapse it again nothing seems to happen.

This is the module that I’m working on (the script has a test case if run directly): http://pastebin.com/ghuVGXWN

Any ideas?

  • Ryan

Here’s what is currently happening:

And here is how it’s suppposed to work (wxPython 2.8 in the pyfa app)

···

On Sunday, March 1, 2015 at 5:33:48 PM UTC-5, Ryan Holmes wrote:

Hello,

I am trying to port over a bit of code from wx2.8 to wxPheonix (3.0.3.dev78356 msw). I’m using code from the pyfa project (https://github.com/DarkFenX/Pyfa) which is currently being rewritten for python3. This code takes some concepts from PyCollapsiblePane and implements it better (there are some bugs with PCP). If you download and open pyfa, the collapsible panels are on the right side (resources, resistances, etc) if you want to get a feel for how it is supposed to work.

Anyway, I’m trying to port this over and I cannot seem to get it to work well. I know Pheonix introduces some changes to sizers and how things are resized. I am able to collapse the panel (and have the parent panel fit to the new size), and then open it again. But when I try to collapse it again nothing seems to happen.

This is the module that I’m working on (the script has a test case if run directly): http://pastebin.com/ghuVGXWN

Any ideas?

  • Ryan

Hi Ryan,

BTW, the sizer changes happened already in 2.9.5.

Just as a quick hack I tried:
             #toggle_panel = TogglePanel(self)
             toggle_panel = pycp.PyCollapsiblePane(self)
             toggle_panel.SetLabel("Test Header")

             #content_panel = toggle_panel.GetContentPanel()
             content_panel = toggle_panel.GetPane()

To me it looks like PyCollabsiblePane as of 2.9.5 behaves correctly.

1. What about consider switching back to PyCollabsiblePane and submit a PR for the optimizations done in pyfa.
2. Check out the differences between 2.8.12 and 2.9.5 or Phoenix of PyCollapsiblePane and reimplement them in pyfa

Werner

Hrm, I could have sworn I tried PCP and it didn’t work correctly. Maybe I fumbled and tried it in 2.8. Seems to work well in Pheonix

I will look into how it resizes everything and implement it into our own version, will post back with the results. I’ll also consider contributing the to module - how does one go about doing this? I primarily use github, but wxPython uses svn. I guess I could contact the original author…

Thanks for pointing me in the right direction. =)

Ryan

···

On Mon, Mar 2, 2015 at 4:19 AM, Werner wernerfbd@gmx.ch wrote:

Hi Ryan,

BTW, the sizer changes happened already in 2.9.5.

Just as a quick hack I tried:

        #toggle_panel = TogglePanel(self)

        toggle_panel = pycp.PyCollapsiblePane(self)

        toggle_panel.SetLabel("Test Header")



        #content_panel = toggle_panel.GetContentPanel()

        content_panel = toggle_panel.GetPane()

To me it looks like PyCollabsiblePane as of 2.9.5 behaves correctly.

  1. What about consider switching back to PyCollabsiblePane and submit a PR for the optimizations done in pyfa.

  2. Check out the differences between 2.8.12 and 2.9.5 or Phoenix of PyCollapsiblePane and reimplement them in pyfa

Werner

You received this message because you are subscribed to a topic in the Google Groups “wxPython-users” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/RDbJuKVdliU/unsubscribe.

To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ryan,

...

I will look into how it resizes everything and implement it into our own version, will post back with the results. I'll also consider contributing the to module - how does one go about doing this? I primarily use github, but wxPython uses svn. I guess I could contact the original author...

wxWidgets and wxPython recently switched to github - ContributeWithGIT - wxPyWiki

Werner

···

On 3/2/2015 16:06, Ryan Holmes wrote:

This is wonderful, thanks so much =)

···

On Mon, Mar 2, 2015 at 10:18 AM, Werner wernerfbd@gmx.ch wrote:

I will look into how it resizes everything and implement it into our own version, will post back with the results. I’ll also consider contributing the to module - how does one go about doing this? I primarily use github, but wxPython uses svn. I guess I could contact the original author…
Hi Ryan,

On 3/2/2015 16:06, Ryan Holmes wrote:

wxWidgets and wxPython recently switched to github - http://wiki.wxpython.org/ContributeWithGIT

Werner

You received this message because you are subscribed to a topic in the Google Groups “wxPython-users” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/RDbJuKVdliU/unsubscribe.

To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.