#34 wxSizers visibility in wxPython

open
nobody
None
5
2014-02-26
2011-08-09
No

Hi all,
I use wxFB in such manner, that I design the main frame of the app while designing other panels, components of the frame, separately.
This combines advantages of both wxFB approach and "manual" approach - I can design stuff easily using wxFB without loosing ability to decide about composition of a frame during run time and possibly being able to reuse a panel with controls in more frames.
However, when putting panels into a frame, a problem emerges. The problem is that wxFB throws away sizers that I use when designing the layout, so it is very difficult to access them in order to insert a panel to the right place.
I would like to choose whether I would like a sizer to become a class' member or not (default being not ATM).
And although I have a feeling that C++ already supports this behavior, please add Python support for this, too (to my knowledge, Python has only public properties, so it is somewhat simpler)
Regards,
Matej

Discussion

  • Axeloide

    Axeloide - 2012-02-01

    I also second this request. It would be great to be able to access sizers in order to dynamically add GUI items to them at runtime.

    I've been diving into the source-code of wxFB and was happy at first to discover the template system. I've tried adding some "self." prefixes to the template at:
    [...]\wxFormBuilder\plugins\layout\xml\layout.pythoncode
    ... but at the end, it turns out there is one change needed, which requires a full recompile:

    http://wxformbuilder.svn.sourceforge.net/viewvc/wxformbuilder/3.x/trunk/src/codegen/pythoncg.cpp?revision=1980&view=markup#l1104

    ... so I couldn't work around this issue. :-/

     
  • Axeloide

    Axeloide - 2012-02-01

    To anybody who is affected by this limitation:

    As a workaround you can do the following:
    Place an invisible dummy widget into the sizer and then you can access that sizer from code with something like:

    m_staticFooBar.GetContainingSizer()

     
  • NotToBeShown

    NotToBeShown - 2014-02-26

    Another vote for this request.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks