Greetings:
I am chugging thru Boa Help
Getting Started Guide for Boa Constructor , Kevin Gill , November 1, 2000
and am at Section: 2.7 Creating a Dialog Window
doing everything as specified in Help, Save/Run and click on Help/About , no Dialog comes up. [Frame2.py , App2.py , Dialog2.py]

When I open module Dialog2.py , then click on Designer , I get the following errors:

7:45:59 PM: Traceback (most recent call last):
7:45:59 PM: File "Models\wxPythonControllers.pyc", line 78, in OnDesigner
7:45:59 PM: File "Models\wxPythonControllers.pyc", line 141, in showDesigner
7:45:59 PM: File "Views\Designer.pyc", line 113, in __init__
7:45:59 PM: AttributeError: 'NoneType' object has no attribute 'params'

See 'Attachments' area? [How come attachments doesn't allow *.py files?]
1) How come Dialog does not show?
2) How to fix for errors above?
Thanks...

That is a pretty old book. The BOA IDE and wxPython have changed quite a bit since then.

Without your code, help would be hard to give.

That is a pretty old book. The BOA IDE and wxPython have changed quite a bit since then.

Without your code, help would be hard to give.

Yes, I tried to Attach files, but it didn't take. Seems that .py is not one of the supported file types. But I'll try again here [changing .py to .txt]:

Attachments
#!/usr/bin/env python
#Boa:App:BoaApp

import wx

import Frame2

modules ={u'Dialog2': [0, '', u'Dialog2.py'],
 'Frame2': [1, 'Main frame of Application', u'Frame2.py']}

class BoaApp(wx.App):
    def OnInit(self):
        self.main = Frame2.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()
#Boa:Dialog:Dialog2

import wx

def create(parent):
    return Dialog2(parent)

[wxID_Dialog2] = [wx.NewId() for _init_ctrls in range(1)]

class Dialog2(wx.Dialog):
    def _init_ctrls(self, prnt):
        wx.Dialog.__init__(self, style=wx.DEFAULT_DIALOG_STYLE, name='', parent=prnt, title='Dialog2', pos=wx.Point(-1, -1), id=wxID_Dialog2, size=wx.Size(-1, -1))

    def __init__(self, parent):
        self._init_ctrls(parent)
#Boa:Frame:Frame2

import wx
#import Dialog2

def create(parent):
    return Frame2(parent)

[wxID_FRAME2, wxID_FRAME2STATUSBAR1, wxID_FRAME2TEXTEDITOR, 
] = [wx.NewId() for _init_ctrls in range(3)]

[wxID_FRAME2MENUFILECLOSE, wxID_FRAME2MENUFILEEXIT, wxID_FRAME2MENUFILEOPEN, 
 wxID_FRAME2MENUFILESAVE, wxID_FRAME2MENUFILESAVEAS, 
] = [wx.NewId() for _init_coll_menuFile_Items in range(5)]

[wxID_FRAME2MENUHELPABOUT] = [wx.NewId() for _init_coll_menuHelp_Items in range(1)]

class Frame2(wx.Frame):
    def _init_coll_menuBar1_Menus(self, parent):
        # generated method, don't edit

        parent.Append(menu=self.menuFile, title='File')
        parent.Append(menu=self.menuHelp, title='Help')

    def _init_coll_menuHelp_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='Help is on the way...', id=wxID_FRAME2MENUHELPABOUT,
              kind=wx.ITEM_NORMAL, text='About')
        self.Bind(wx.EVT_MENU, self.OnMenuHelpAboutMenu,
              id=wxID_FRAME2MENUHELPABOUT)

    def _init_coll_menuFile_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='Open a File...', id=wxID_FRAME2MENUFILEOPEN,
              kind=wx.ITEM_NORMAL, text='Open')
        parent.Append(help='Save File...', id=wxID_FRAME2MENUFILESAVE,
              kind=wx.ITEM_NORMAL, text='Save')
        parent.Append(help='Save File As...', id=wxID_FRAME2MENUFILESAVEAS,
              kind=wx.ITEM_NORMAL, text='SaveAs')
        parent.Append(help='Close File...', id=wxID_FRAME2MENUFILECLOSE,
              kind=wx.ITEM_NORMAL, text='Close')
        parent.Append(help='Exit Program...', id=wxID_FRAME2MENUFILEEXIT,
              kind=wx.ITEM_NORMAL, text='Exit')
        self.Bind(wx.EVT_MENU, self.OnMenuFileOpenMenu,
              id=wxID_FRAME2MENUFILEOPEN)
        self.Bind(wx.EVT_MENU, self.OnMenuFileSaveMenu,
              id=wxID_FRAME2MENUFILESAVE)
        self.Bind(wx.EVT_MENU, self.OnMenuFileSaveasMenu,
              id=wxID_FRAME2MENUFILESAVEAS)
        self.Bind(wx.EVT_MENU, self.OnMenuFileCloseMenu,
              id=wxID_FRAME2MENUFILECLOSE)
        self.Bind(wx.EVT_MENU, self.OnMenuFileExitMenu,
              id=wxID_FRAME2MENUFILEEXIT)

    def _init_coll_statusBar1_Fields(self, parent):
        # generated method, don't edit
        parent.SetFieldsCount(1)

        parent.SetStatusText(number=0, text='status')

        parent.SetStatusWidths([-1])

    def _init_utils(self):
        # generated method, don't edit
        self.menuFile = wx.Menu(title='File')

        self.menuHelp = wx.Menu(title='Help')

        self.menuBar1 = wx.MenuBar()

        self._init_coll_menuFile_Items(self.menuFile)
        self._init_coll_menuHelp_Items(self.menuHelp)
        self._init_coll_menuBar1_Menus(self.menuBar1)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_FRAME2, name='', parent=prnt,
              pos=wx.Point(627, 173), size=wx.Size(400, 489),
              style=wx.DEFAULT_FRAME_STYLE, title='Notebook')
        self._init_utils()
        self.SetClientSize(wx.Size(392, 455))
        self.SetMenuBar(self.menuBar1)

        self.statusBar1 = wx.StatusBar(id=wxID_FRAME2STATUSBAR1,
              name='statusBar1', parent=self, style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

        self.textEditor = wx.TextCtrl(id=wxID_FRAME2TEXTEDITOR,
              name='textEditor', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(392, 412), style=wx.TE_MULTILINE, value='')

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.FileName=None  

    def OnMenuFileOpenMenu(self, event):
        dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.*', wx.OPEN)
        try:
            if dlg.ShowModal() == wx.ID_OK:
                filename = dlg.GetPath()
                # Your code
                self.textEditor.LoadFile(filename) 
                self.FileName=filename
                self.SetTitle(('Notebook - %s') % filename)                 
        finally:
            dlg.Destroy() # event.Skip()

    def OnMenuFileSaveMenu(self, event):
        if self.FileName == None:
            return self.OnFileSaveasMenu(event)
        else:
            self.textEditor.SaveFile(self.FileName)  # event.Skip()

    def OnMenuFileSaveasMenu(self, event):
        dlg = wx.FileDialog(self, 'Save file as', '.', '', '*.*', wx.SAVE)
        try:
            if dlg.ShowModal() == wx.ID_OK:
                filename = dlg.GetPath()
                # Your code
                self.textEditor.LoadFile(filename) 
                self.FileName=filename
                self.SetTitle(('Notebook - %s') % filename)                 
        finally:
            dlg.Destroy()  # event.Skip()

    def OnMenuFileCloseMenu(self, event):
        self.textEditor.LoadFile(filename) 
        self.FileName=filename
        self.SetTitle(('Notebook - %s') % filename)  # event.Skip()

    def OnMenuFileExitMenu(self, event):
         self.Close()   # event.Skip()

    def OnMenuHelpAboutMenu(self, event):
        dlg = Dialog2.Dialog2(self)
        try:
            dlg.ShowModal()
        finally:
            dlg.Destroy()  #  event.Skip()

I mysteriously got past the Designer prob.
But now cant' open Dialog2 frame.
So I'l post as new prob.

I think BOA isn't for NewBie. I say this because text editor is best for learning actual coding. I'm talking about using IDE's Wxpython GUI builder. If you use it as Editor and and run directly scripts fine.

I will suggest building GUIs with your hand-on-keyboard programming instead of dag-and-drop building.

You can use any editor (so many there) for practicing, and when you start massive coding, then IDE is for you

Just MHO
Steve

I'm talking about using IDE's Wxpython GUI builder. If you use it as Editor and and run directly scripts fine.

Just MHO
Steve

[IDE's Wxpython GUI builder]
Do you mean IDLE, or does Wxpython, have a separate GUI builder.
Thanks!

For a simple BOA test program using a frame and a dialog see:
http://www.daniweb.com/forums/post722453-3.html

You can use other IDE's to create wxPython programs, but they won't necessarily have drag and drop builders. The builder just creates your widget base, you have to learn where to add your own code to make it all work. If you edit in the wrong places to add your code, the designer may balk at opening the code for further widget additions.

[IDE's Wxpython GUI builder]
Do you mean IDLE, or does Wxpython, have a separate GUI builder.
Thanks!

BOA have got GUI builder. I wonder if you are using that to make your GUIs. If so I was advising to stop using drage and drop thing and do it fro scratch

Apart from Boa & WxDesigner (Which I have never tested) I don't know any other builder with D&D feature! Just as sneekula said

Turns out:
When I get the Boa Error msg:
"AttributeError: 'NoneType' object has no attribute 'params'"
If I save files, shutdown Boa,
then ReStart Boa, all is well.
Cute huh!

This article has been dead for over six months. Start a new discussion instead.