guidelines to make this

First of all im very nub on programing and even more on wxpython.

I want to type a prog with the following gui structure.

1 mainframe with like 10 different panels each of them for certain
tasks, so following that objective i dont know how to kill/hide a
panel for the soft to show the next (when the user clicks certain
button).

The problem is that using this pattern

class marco(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,id,title, size=(800,600),
pos=(60,60))

        self.parent = parent
        self.initialize()

    def initialize(self):
        marco = wx.Frame (None,-1)
        if laser==1:
            ventana1 = wx.Panel(self)
            ventana1.SetBackgroundColour('Red')
            ventana1.Show=(True)
            self.Bind(wx.EVT_CLOSE, self.xventana)
            self.Show(True)
            botoncambio = wx.Button(ventana1, -1, 'Cambio',
pos=(680,510), size=(90,30))
            self.Bind(wx.EVT_BUTTON, self.cambioboton, botoncambio)

        else:
            ventana2 = wx.Panel(self)
            ventana2.SetBackgroundColour('Blue')
            ventana.Show=(True)
            self.Bind(wx.EVT_CLOSE, self.xventana)

            #mostrar todo
            self.Show(True)

    def cambioboton(self,event):
        global laser
        laser +=1
        self.ventana.Destroy()
        self.initialize()

the trick isnt working ... just want you guys to consider give me a
guideline or maybe a library to sort this out...

thanks in advance!

Hi,

Not the great expert here, so take comments with a grain of salt.

First of all im very nub on programing and even more on wxpython.

I want to type a prog with the following gui structure.

1 mainframe with like 10 different panels each of them for certain
tasks, so following that objective i dont know how to kill/hide a
panel for the soft to show the next (when the user clicks certain
button).

The problem is that using this pattern

class marco(wx.Frame):
     def __init__(self,parent,id,title):
         wx.Frame.__init__(self,parent,id,title, size=(800,600),
pos=(60,60))

         self.parent = parent
         self.initialize()

     def initialize(self):
         marco = wx.Frame (None,-1)
   

What you trying with the above? "marco" isn't used in the method and as it is defined as a local variable (i.e. not global or not self.marco) it will just get garbage collected when "initialize" terminates.

Unless you want another frame to be shown I don't think you need this here at all.

         if laser==1:
             ventana1 = wx.Panel(self)
             ventana1.SetBackgroundColour('Red')
             ventana1.Show=(True)
             self.Bind(wx.EVT_CLOSE, self.xventana)
             self.Show(True)
             botoncambio = wx.Button(ventana1, -1, 'Cambio',
pos=(680,510), size=(90,30))
             self.Bind(wx.EVT_BUTTON, self.cambioboton, botoncambio)

         else:
             ventana2 = wx.Panel(self)
             ventana2.SetBackgroundColour('Blue')
             ventana.Show=(True)
             self.Bind(wx.EVT_CLOSE, self.xventana)

             #mostrar todo
             self.Show(True)

     def cambioboton(self,event):
         global laser
         laser +=1
         self.ventana.Destroy()
         self.initialize()

the trick isnt working ... just want you guys to consider give me a
guideline or maybe a library to sort this out...
   

Should the user be able to "jump" from one to the other panel? If yes then probably one of the "book" controls, check out the wxPython demo (separate download) and I recommend to look through all the demo's to see all the available widgets - this might give you an idea which is best for your use case.

Another option might be a wizard like UI, i.e. you guide the user from panel to panel until he provided all the information.

Hope this helps and have fun!
Werner

···

On 18/03/2010 01:19, monobot wrote:

werner <wbruhin <at> free.fr> writes:

...

Should the user be able to "jump" from one to the other panel? If yes
then probably one of the "book" controls, check out the wxPython demo
(separate download) and I recommend to look through all the demo's to
see all the available widgets - this might give you an idea which is
best for your use case.

Another option might be a wizard like UI, i.e. you guide the user from
panel to panel until he provided all the information.

Hope this helps and have fun!
Werner

Thanks Werner, could you adress me to the wxpython demo u are talking about?
thanks again

The demo is on the same page that most people download wxPython from:

http://wxpython.org/download.php

If you're on Windows, the link is about half way down the page. If
you're on Linux, I think the package manager will list it.

···

On Mar 18, 6:28 am, monobot <hector...@gmail.com> wrote:

werner <wbruhin <at> free.fr> writes:

...

> Should the user be able to "jump" from one to the other panel? If yes
> then probably one of the "book" controls, check out the wxPython demo
> (separate download) and I recommend to look through all the demo's to
> see all the available widgets - this might give you an idea which is
> best for your use case.

> Another option might be a wizard like UI, i.e. you guide the user from
> panel to panel until he provided all the information.

> Hope this helps and have fun!
> Werner

Thanks Werner, could you adress me to the wxpython demo u are talking about?
thanks again

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org