|
List Info
Thread: Problem with Sizer initialize when using XRC
|
|
| Problem with Sizer initialize when
using XRC |
  United States |
2007-06-05 05:30:24 |
|
In DB (v 4.08) one can assign a member variable name to a Sizer (let
us say m_MySizer), but when using XRC files this member is not
initialized.
There is for example a
wxBoxSizer* m_MySizer;
in the header file and there is a
m_MySizer = NULL;
in the MyApp::Init()
but nothing else.
Consequently any m_MySizer->Add(...) crashes the program.
I added something like this to the MyApp::Init()
m_MySizer = (wxBoxSizer *) m_MyPanel->GetSizer();
but would have expected that DB would do that.
Suggestions welcome,
Cees.
__._,_.___
.
__,_._,___
|
| Re: Problem with Sizer initialize when
using XRC |
  United Kingdom |
2007-06-05 07:28:41 |
|
Hi,
The problem is that in general you can't retrieve a specific sizer from
an XRC hierarchy (they're not named), so I'm not sure how DB would
really do this. Getting the top-level sizer as you suggest would only be
a partial solution.
Regards,
Julian
motormuizen wrote:
> In DB (v 4.08) one can assign a member variable name to a Sizer (let
> us say m_MySizer), but when using XRC files this member is not
> initialized.
>
> There is for example a
>
> wxBoxSizer* m_MySizer;
>
> in the header file and there is a
>
> m_MySizer = NULL;
>
> in the MyApp::Init()
>
> but nothing else.
>
> Consequently any m_MySizer->Add(...) crashes the program.
>
> I added something like this to the MyApp::Init()
>
> m_MySizer = (wxBoxSizer *) m_MyPanel->GetSizer();
>
> but would have expected that DB would do that.
>
>
> Suggestions welcome,
>
> Cees.
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
--
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD: www.anthemion.co.uk/dialogblocks
__._,_.___
.
__,_._,___
|
| Re: Problem with Sizer initialize when
using XRC |
  United States |
2007-06-05 08:25:28 |
|
I don't think he's necessarily talking about getting the top-level
sizer. I've been picking a control that's directly contained by the
sizer and calling GetSizer() on it to set the variable that's defined
in DB. It works fine manually, but it would be nice if DB could do
it.
Phillip
On 6/5/07, Julian Smart < julian%40anthemion.co.uk">julian anthemion.co.uk> wrote:
> Hi,
>
> The problem is that in general you can't retrieve a specific sizer from
> an XRC hierarchy (they're not named), so I'm not sure how DB would
> really do this. Getting the top-level sizer as you suggest would only be
> a partial solution.
>
> Regards,
>
> Julian
>
> motormuizen wrote:
> > In DB (v 4.08) one can assign a member variable name to a Sizer (let
> > us say m_MySizer), but when using XRC files this member is not
> > initialized.
> >
> > There is for example a
> >
> > wxBoxSizer* m_MySizer;
> >
> > in the header file and there is a
> >
> > m_MySizer = NULL;
> >
> > in the MyApp::Init()
> >
> > but nothing else.
> >
> > Consequently any m_MySizer->Add(...) crashes the program.
> >
> > I added something like this to the MyApp::Init()
> >
> > m_MySizer = (wxBoxSizer *) m_MyPanel->GetSizer();
> >
> > but would have expected that DB would do that.
> >
> >
> > Suggestions welcome,
> >
> > Cees.
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>
>
> --
> Julian Smart, Anthemion Software Ltd.
> 28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
> www.anthemion.co.uk | +44 (0)131 229 5306
> Tools for writers: www.writerscafe.co.uk
> wxWidgets RAD: www.anthemion.co.uk/dialogblocks
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
__._,_.___
.
__,_._,___
|
| Re: Problem with Sizer initialize when
using XRC |
  United Kingdom |
2007-06-05 08:38:40 |
|
Hi,
Phillip Seaver wrote:
> I don't think he's necessarily talking about getting the top-level
> sizer. I've been picking a control that's directly contained by the
> sizer and calling GetSizer() on it to set the variable that's defined
> in DB. It works fine manually, but it would be nice if DB could do
> it.
>
I'm confused - surely wxWindow::GetSizer() returns that window's
top-level sizer, rather than a sizer that contains that window?
(By top-level sizer I mean the sizer that's a child of any given window
that does its own sizer layout, not one sizer per whole dialog.)
Regards,
Julian
__._,_.___
.
__,_._,___
|
| Re: Problem with Sizer initialize when
using XRC |
  United States |
2007-06-05 11:04:17 |
|
On 6/5/07, Julian Smart < julian%40anthemion.co.uk">julian anthemion.co.uk> wrote:
> Hi,
>
> Phillip Seaver wrote:
> > I don't think he's necessarily talking about getting the top-level
> > sizer. I've been picking a control that's directly contained by the
> > sizer and calling GetSizer() on it to set the variable that's defined
> > in DB. It works fine manually, but it would be nice if DB could do
> > it.
> >
> I'm confused - surely wxWindow::GetSizer() returns that window's
> top-level sizer, rather than a sizer that contains that window?
>
> (By top-level sizer I mean the sizer that's a child of any given window
> that does its own sizer layout, not one sizer per whole dialog.)
>
> Regards,
>
> Julian
Oops. I do GetContainingSizer() on a control, which does what I said. :-}
Phillip
__._,_.___
.
__,_._,___
|
[1-5]
|
|