newbie question: dynamically adding items to a panel

Hi,

I want to add some items to a panel when an event occurs. But when I
run the attached code, items are appearing on the same point. The
flexgridsizer which I added the items is not working.

Any help or advise so appreciated.

Evren Esat ÖZKAN
sleytr@gmail.com
sLeytr.net

AyarBankaGui2.py (4.76 KB)

After adding the controls to the sizer you must layout it or layout the
panel that own it.

self.panelyeni.Layout()
or
gs.Layout()

Ricardo

···

On Tue, 2006-05-02 at 19:07 +0300, Evren Esat OZKAN wrote:

Hi,

I want to add some items to a panel when an event occurs. But when I
run the attached code, items are appearing on the same point. The
flexgridsizer which I added the items is not working.

Any help or advise so appreciated.

Thanks, It's worked. But this time I stucked with another problem. The
new sizer does not delete the old one. According to docs setsizer
metod must remove the old one but it doesn't. How can I remove a sizer
from a widget?

thanks again.

AyarBankaGui2.py (5 KB)

···

On 5/2/06, Ricardo Pedroso <ricardo.pedroso@netvisao.pt> wrote:

On Tue, 2006-05-02 at 19:07 +0300, Evren Esat OZKAN wrote:
> Hi,
>
> I want to add some items to a panel when an event occurs. But when I
> run the attached code, items are appearing on the same point. The
> flexgridsizer which I added the items is not working.
>
> Any help or advise so appreciated.

After adding the controls to the sizer you must layout it or layout the
panel that own it.

self.panelyeni.Layout()
or
gs.Layout()

Ricardo

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--

Evren Esat ÖZKAN
sleytr@gmail.com
sLeytr.net

Ok, I solved my problem with adding `self.panelyeni.DestroyChildren()`
before creating the new sizer. But I'm just wondering if is there a
more elegant way to achieve the same goal? (changing content of some
widget)

···

On 5/2/06, Evren Esat OZKAN <sleytr@gmail.com> wrote:

Thanks, It's worked. But this time I stucked with another problem. The
new sizer does not delete the old one. According to docs setsizer
metod must remove the old one but it doesn't. How can I remove a sizer
from a widget?

thanks again.

On 5/2/06, Ricardo Pedroso <ricardo.pedroso@netvisao.pt> wrote:
> On Tue, 2006-05-02 at 19:07 +0300, Evren Esat OZKAN wrote:
> > Hi,
> >
> > I want to add some items to a panel when an event occurs. But when I
> > run the attached code, items are appearing on the same point. The
> > flexgridsizer which I added the items is not working.
> >
> > Any help or advise so appreciated.
>
> After adding the controls to the sizer you must layout it or layout the
> panel that own it.
>
> self.panelyeni.Layout()
> or
> gs.Layout()
>
> Ricardo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
>

--

Evren Esat ÖZKAN
sleytr@gmail.com
sLeytr.net

--

Evren Esat ÖZKAN
sleytr@gmail.com
sLeytr.net