Problem on the windows behavior (again)

Could any1 please guide me on how to avoid multiple versions of the frames?

i can see 2 options:
force to close the window before u can pop any other.
or if u click oneother time the same button the previous window comes
foreground.

BUT, i cant make that … any help?
Thanks in advance

PD: The code is posted in the previous post wasnt runable sorry i forgot to attach the bmps, sorry and thanks again

esqueleto PARA WXPYTHON.py (5.69 KB)

···


monobotblog.alvarezalonso.es

monoBOT wrote:

Could any1 please guide me on how to avoid multiple versions of the frames?

i can see 2 options: force to close the window before u can pop any other.

not good.

or if u click oneother time the same button the previous window comes foreground.

BUT, i cant make that .... any help?

In your main Frame (or even the app object) put:

    self.SomeFrame=None

in the __init__

Then in the handler for whatever pops up that frame, put:

         if self.SomeFrame is None:
             self.SomeFrame = HelpFrame(self, title="Converter Help")
         self.SomeFrame.Show()
         self.SomeFrame.Raise()

I added:

      def OnClose(self, evt):
         self.Hide()

to the SomeFrame, so that it will get hidden, rather than deleted when the user closes it. If you dont' do that, you'll need to make sure that self.SomeFrame is kept up to date (or check for the exception when you try to Show() it)

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Great Man!!!

many thanks im checking that.

···

On 15 abr, 19:20, Christopher Barker <Chris.Bar...@noaa.gov> wrote:

monoBOT wrote:
> Could any1 please guide me on how to avoid multiple versions of the frames?
> i can see 2 options:
> force to close the window before u can pop any other.

not good.

> or if u click oneother time the same button the previous window comes
> foreground.

> BUT, i cant make that .... any help?

In your main Frame (or even the app object) put:

self\.SomeFrame=None

in the __init__

Then in the handler for whatever pops up that frame, put:

     if self\.SomeFrame is None:
         self\.SomeFrame = HelpFrame\(self, title=&quot;Converter Help&quot;\)
     self\.SomeFrame\.Show\(\)
     self\.SomeFrame\.Raise\(\)

I added:

  def OnClose\(self, evt\):
     self\.Hide\(\)

to the SomeFrame, so that it will get hidden, rather than deleted when
the user closes it. If you dont' do that, you'll need to make sure that
self.SomeFrame is kept up to date (or check for the exception when you
try to Show() it)

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Bar...@noaa.gov

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Checked!!!

Your system works perfectly.

just a thing, i was using a MDIParent/Child system on the real program
(not the squeleton i sent)
on that the way to go is using the
Activate (on the child)
GetActive (on the parent)

Thanks again

···

On 16 abr, 09:11, monobot <hector...@gmail.com> wrote:

Great Man!!!

many thanks im checking that.

On 15 abr, 19:20, Christopher Barker <Chris.Bar...@noaa.gov> wrote:

> monoBOT wrote:
> > Could any1 please guide me on how to avoid multiple versions of the frames?
> > i can see 2 options:
> > force to close the window before u can pop any other.

> not good.

> > or if u click oneother time the same button the previous window comes
> > foreground.

> > BUT, i cant make that .... any help?

> In your main Frame (or even the app object) put:

> self.SomeFrame=None

> in the __init__

> Then in the handler for whatever pops up that frame, put:

> if self.SomeFrame is None:
> self.SomeFrame = HelpFrame(self, title="Converter Help")
> self.SomeFrame.Show()
> self.SomeFrame.Raise()

> I added:

> def OnClose(self, evt):
> self.Hide()

> to the SomeFrame, so that it will get hidden, rather than deleted when
> the user closes it. If you dont' do that, you'll need to make sure that
> self.SomeFrame is kept up to date (or check for the exception when you
> try to Show() it)

> -Chris

> --
> Christopher Barker, Ph.D.
> Oceanographer

> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception

> Chris.Bar...@noaa.gov

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visithttp://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Now i got a problem related to this 1.

Now the windows do what its asked, they close and open 1 instance each
time.

But my program gets and shows information from a xml file, and the
user can save information on the same xml file, what i need is that
the frames programatically "refresh" their content, when using the
destroy-create method that worked fine but now it doesnt, since the
frames are permanent, and if i destroy them and try to create again
(using the same variable name) pops a C widgets error.

So my question is: Is there a way to force a complete renewal of a
frame not just a refresh?
has any1 solved a similar problem and how?

thanks folks

···

On 16 abr, 12:06, monobot <hector...@gmail.com> wrote:

Checked!!!

Your system works perfectly.

just a thing, i was using a MDIParent/Child system on the real program
(not the squeleton i sent)
on that the way to go is using the
Activate (on the child)
GetActive (on the parent)

Thanks again

On 16 abr, 09:11, monobot <hector...@gmail.com> wrote:

> Great Man!!!

> many thanks im checking that.

> On 15 abr, 19:20, Christopher Barker <Chris.Bar...@noaa.gov> wrote:

> > monoBOT wrote:
> > > Could any1 please guide me on how to avoid multiple versions of the frames?
> > > i can see 2 options:
> > > force to close the window before u can pop any other.

> > not good.

> > > or if u click oneother time the same button the previous window comes
> > > foreground.

> > > BUT, i cant make that .... any help?

> > In your main Frame (or even the app object) put:

> > self.SomeFrame=None

> > in the __init__

> > Then in the handler for whatever pops up that frame, put:

> > if self.SomeFrame is None:
> > self.SomeFrame = HelpFrame(self, title="Converter Help")
> > self.SomeFrame.Show()
> > self.SomeFrame.Raise()

> > I added:

> > def OnClose(self, evt):
> > self.Hide()

> > to the SomeFrame, so that it will get hidden, rather than deleted when
> > the user closes it. If you dont' do that, you'll need to make sure that
> > self.SomeFrame is kept up to date (or check for the exception when you
> > try to Show() it)

> > -Chris

> > --
> > Christopher Barker, Ph.D.
> > Oceanographer

> > Emergency Response Division
> > NOAA/NOS/OR&R (206) 526-6959 voice
> > 7600 Sand Point Way NE (206) 526-6329 fax
> > Seattle, WA 98115 (206) 526-6317 main reception

> > Chris.Bar...@noaa.gov

> --
> To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
> or visithttp://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visithttp://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Give the frame class a method that rebuilds its content (whatever that may be, rebuilding data structures, setting values in widgets, whatever) given the new XML file. Call that method when needed.

···

On 4/29/10 12:06 AM, monobot wrote:

Now i got a problem related to this 1.

Now the windows do what its asked, they close and open 1 instance each
time.

But my program gets and shows information from a xml file, and the
user can save information on the same xml file, what i need is that
the frames programatically "refresh" their content, when using the
destroy-create method that worked fine but now it doesnt, since the
frames are permanent, and if i destroy them and try to create again
(using the same variable name) pops a C widgets error.

So my question is: Is there a way to force a complete renewal of a
frame not just a refresh?
has any1 solved a similar problem and how?

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en