[wxPython] newbee how to create a new wxFrame with Boa.

good morning.

I had been working (discovering) wxpython for a week .
I whant to create a nex wxFrame when i have an event send by a button.
see under.

···

______________________________________________
class trianon(wxFrame):
.......
    self.bouton_tri = wxButton(label = 'trier', id =
wxID_TRIANONBOUTON_TRI, parent = self, name = 'bouton_tri', size
= wxSize(80, 22), style = 0, pos = wxPoint(160, 168))
        EVT_BUTTON(self.bouton_tri, wxID_TRIANONBOUTON_TRI,
self.OnBouton_triButton)
______________________________________________

i catch it with my founction.
______________________________________________
    def OnBouton_triButton(self, event):
______________________________________________

I create a new wxFrame named wxframetri.py

______________________________________________

#Boa:Frame:wxframetri

from wxPython.wx import *

def create(parent):
    return wxframetri(parent)

[wxID_WXFRAMETRI] = map(lambda _init_ctrls: wxNewId(), range(1))

class wxframetri(wxFrame):
    def _init_utils(self):
        pass

    def _init_ctrls(self, prnt):
        wxFrame.__init__(self, size = wxSize(640, 445), id = wxID_WXFRAMETRI, title = 'tri des fichiers resultats', parent = prnt, name = 'wxframetri', style = wxDEFAULT_FRAME_STYLE, pos = wxPoint(354, 375))
        self._init_utils()

    def __init__(self, parent):
        self._init_ctrls(parent)

________________________________________________

but i do not be able to conect my event fron the class trianon to the new wxframetri.py.

Can someone help me, in telling how to do it or telling where i can found exemple where i will be able to solve my riddle?

Thanks for answer.

regards

Excuse me for bad english!

--
                            \\\|///
                          \\ - - //
                           ( @ @ )
+-----------------------oOOo-(_)-oOOo--------------------+

Famy William 36 avenue des barattes 74000 Annecy France|
email:william.famy@noos.fr |
     william.famy@mail-enseignant.com |

+--------------------------------Oooo--------------------+
                           oooO ( )
                          ( ) ) /
                           \ ( (_/
                            \_)

First import the new frame module in your parent frame module

from wxPython.wx import *
import wxframetri

--snip

OnBouton_triButton(self, event):
    self.NewTri = wxframetri.create(self)
    self.NewTri.Show (true)

It's the same as the wxApp module with the exception of specifying self as
parent in this case so closing the parent will also close the child etc...

Rick

···

----- Original Message -----
From: "William Famy" <william.famy@noos.fr>
To: <wxpython-users@lists.wxwindows.org>
Sent: Saturday, June 16, 2001 5:47 PM
Subject: [wxPython] newbee how to create a new wxFrame with Boa.

good morning.

I had been working (discovering) wxpython for a week .
I whant to create a nex wxFrame when i have an event send by a button.
see under.
______________________________________________
class trianon(wxFrame):
.......
    self.bouton_tri = wxButton(label = 'trier', id =
wxID_TRIANONBOUTON_TRI, parent = self, name = 'bouton_tri', size
= wxSize(80, 22), style = 0, pos = wxPoint(160, 168))
        EVT_BUTTON(self.bouton_tri, wxID_TRIANONBOUTON_TRI,
self.OnBouton_triButton)
______________________________________________

i catch it with my founction.
______________________________________________
    def OnBouton_triButton(self, event):
______________________________________________

I create a new wxFrame named wxframetri.py

______________________________________________

#Boa:Frame:wxframetri

from wxPython.wx import *

def create(parent):
    return wxframetri(parent)

[wxID_WXFRAMETRI] = map(lambda _init_ctrls: wxNewId(), range(1))

class wxframetri(wxFrame):
    def _init_utils(self):
        pass

    def _init_ctrls(self, prnt):
        wxFrame.__init__(self, size = wxSize(640, 445), id =

wxID_WXFRAMETRI, title = 'tri des fichiers resultats', parent = prnt, name =
'wxframetri', style = wxDEFAULT_FRAME_STYLE, pos = wxPoint(354, 375))

        self._init_utils()

    def __init__(self, parent):
        self._init_ctrls(parent)

________________________________________________

but i do not be able to conect my event fron the class trianon to the new

wxframetri.py.

Can someone help me, in telling how to do it or telling where i can found

exemple where i will be able to solve my riddle?

Thanks for answer.

regards

Excuse me for bad english!

--
                            \\\|///
                          \\ - - //
                           ( @ @ )
+-----------------------oOOo-(_)-oOOo--------------------+
>Famy William 36 avenue des barattes 74000 Annecy France|
>email:william.famy@noos.fr |
> william.famy@mail-enseignant.com |
+--------------------------------Oooo--------------------+
                           oooO ( )
                          ( ) ) /
                           \ ( (_/
                            \_)

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Hello William,

You need to add the following (by hand) to the code:

William Famy wrote:

good morning.

I had been working (discovering) wxpython for a week .
I whant to create a nex wxFrame when i have an event send by a button.
see under.
______________________________________________

import wxframetri

class trianon(wxFrame):
.......
    self.bouton_tri = wxButton(label = 'trier', id =
wxID_TRIANONBOUTON_TRI, parent = self, name = 'bouton_tri', size
= wxSize(80, 22), style = 0, pos = wxPoint(160, 168))
        EVT_BUTTON(self.bouton_tri, wxID_TRIANONBOUTON_TRI,
self.OnBouton_triButton)
______________________________________________

i catch it with my founction.
______________________________________________
    def OnBouton_triButton(self, event):

           newFrame = wxframetri.create(self)
           newFrame.Show(true)

I will add an example of different ways to manage your frames in
the Boa examples directory.

···

--
Riaan Booysen
___________________________________________________
Boa Constructor - RAD GUI building IDE for wxPython
     http://boa-constructor.sourceforge.net

Thanks for your answer.

regards. I will try it as soon as possible.

regards.

···

--
                            \\\|///
                          \\ - - //
                           ( @ @ )
+-----------------------oOOo-(_)-oOOo--------------------+

Famy William 36 avenue des barattes 74000 Annecy France|
email:william.famy@noos.fr |
     william.famy@mail-enseignant.com |

+--------------------------------Oooo--------------------+
                           oooO ( )
                          ( ) ) /
                           \ ( (_/
                            \_)