Discussion:
Referencing items within a wxBoxSizer
Tim Burgess
2014-04-03 13:46:13 UTC
Permalink
Hi,

I have a wxBoxSizer that contains two controls. These controls are created
dynamically, so I don't know their handles in order to use GetItem() to
reference them. How can I reference them, given this constraint, please?

Best wishes.
Tim Burgess
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-04-04 15:03:47 UTC
Permalink
On Thu, 3 Apr 2014 14:46:13 +0100 Tim Burgess wrote:

TB> I have a wxBoxSizer that contains two controls. These controls are created
TB> dynamically, so I don't know their handles in order to use GetItem() to
TB> reference them. How can I reference them, given this constraint, please?

You could use GetItemById(). Or you could save the "handle" -- the fact
that an object is created dynamically doesn't mean that you can't keep a
pointer to it.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Tim Burgess
2014-04-04 17:27:54 UTC
Permalink
OK, got it - thanks.


Best wishes.
Tim Burgess

-----Original Message-----
From: wx-***@googlegroups.com [mailto:wx-***@googlegroups.com] On Behalf
Of Vadim Zeitlin
Sent: 04 April 2014 16:04
To: wx-***@googlegroups.com
Subject: Re: Referencing items within a wxBoxSizer

On Thu, 3 Apr 2014 14:46:13 +0100 Tim Burgess wrote:

TB> I have a wxBoxSizer that contains two controls. These controls are
TB> created dynamically, so I don't know their handles in order to use
TB> GetItem() to reference them. How can I reference them, given this
constraint, please?

You could use GetItemById(). Or you could save the "handle" -- the fact
that an object is created dynamically doesn't mean that you can't keep a
pointer to it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...