Issues with Boa generated code and User Code
Nathaniel Hayes <[email protected]> Fri, 23 Oct 2009 12:41:22 -0400
| Newsgroups | gmane.comp.ide.boa-constructor.user |
|---|---|
| Message-ID | <[email protected]> |
--===============3763713501635853728==
Content-Type: multipart/alternative; boundary=000e0cd598dad02e4904769ce179
--000e0cd598dad02e4904769ce179
Content-Type: text/plain; charset=ISO-8859-1
I picked up Boa as a replacement for Delphi here, as we are slowly switching
to Python over Fortran, C etc. Im rewriting my Tk GUI code with Boa and
mostly it's going alright, however I am running into some issues with Boa's
generated code and my own. I use a listbox to allow the user to choose
which device they wish to use, in TK this was straightforward and easy, as
it was entirely written by me, looks something like this:
devices = daq.GetDeviceList()
self.devicebox = Listbox(self)
self.devicebox.grid(row=1, column=0, rowspan=2)
for item in devices:
self.devicebox.insert(END, item)
Now, in Boa, I came up with mostly the same deal:
def __init__(self, parent):
devicesList = daq.GetDeviceList()
self.deviceList = devicesList
self.curdevice = False
self._init_ctrls(parent)
and then later in the __init__ctrls I changed the listbox's choices option
to: self.deviceList
self.allDevices = wx.ListBox(choices=self.deviceList,
id=wxID_CHOOSEDEVICEALLDEVICES,
name='allDevices', parent=self, pos=wx.Point(24, 32),
size=wx.Size(132, 63), style=0)
When it's run, the code run's fine, however when I try to use the
constructor again I get an error about either daq not being attribute of the
class, or deviceList not being an attribute of the class, so if I want to
alter the window I have to change the listbox's options back to normal, fix
use the constructor then switch the listbox back. I looked through the
documentation and it mentioned so long as I had declared it in the __init__
I would be able to put it in the __init__ctrls, but getting these errors is
kind of off putting.
--
Nathaniel Christopher Hayes
Third Year Mechanical Engineering
Email: [email protected]
--000e0cd598dad02e4904769ce179
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I picked up Boa as a replacement for Delphi here, as we are slowly switchin=
g to Python over Fortran, C etc.=A0 Im rewriting my Tk GUI code with Boa an=
d mostly it's going alright, however I am running into some issues with=
Boa's generated code and my own.=A0 I use a listbox to allow the user =
to choose which device they wish to use, in TK this was straightforward and=
easy, as it was entirely written by me, looks something like this:<br>
<br>=A0=A0=A0=A0=A0=A0=A0 devices =3D daq.GetDeviceList()<br>=A0=A0=A0=A0=
=A0=A0=A0 self.devicebox =3D Listbox(self)<br>=A0=A0=A0=A0=A0=A0=A0 self.de=
vicebox.grid(row=3D1, column=3D0, rowspan=3D2)<br>=A0=A0=A0=A0=A0=A0=A0 <br=
>=A0=A0=A0=A0=A0=A0=A0 for item in devices:<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 self.devicebox.insert(END, item)<br>
<br>Now, in Boa, I came up with mostly the same deal:<br><br>=A0=A0=A0 def =
__init__(self, parent):<br>=A0=A0=A0=A0=A0=A0=A0 devicesList =3D daq.GetDev=
iceList()<br>=A0=A0=A0=A0=A0=A0=A0 self.deviceList =3D devicesList<br>=A0=
=A0=A0=A0=A0=A0=A0 self.curdevice =3D False<br>=A0=A0=A0=A0=A0=A0=A0 self._=
init_ctrls(parent)<br>
<br>and then later in the __init__ctrls=A0 I changed the listbox's choi=
ces option to:=A0 self.deviceList<br><br>=A0=A0=A0=A0=A0=A0=A0 self.allDevi=
ces =3D wx.ListBox(choices=3Dself.deviceList, <br>=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 id=3DwxID_CHOOSEDEVICEALLDEVICES,<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 name=3D'allDevices', parent=
=3Dself, pos=3Dwx.Point(24, 32),<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
size=3Dwx.Size(132, 63), style=3D0)<br><br>When it's run, the code run=
's fine, however when I try to use the constructor again I get an error=
about either daq not being attribute of the class, or deviceList not being=
an attribute of the class, so if I want to alter the window I have to chan=
ge the listbox's options back to normal, fix use the constructor then s=
witch the listbox back.=A0 I looked through the documentation and it mentio=
ned so long as I had declared it in the __init__ I would be able to put it =
in the __init__ctrls, but getting these errors is kind of off putting.<br c=
lear=3D"all">
<br>-- <br>Nathaniel Christopher Hayes<br>Third Year Mechanical Engineering=
<br>Email: <a href=3D"mailto:[email protected]">nathaniel.hayes@mai=
ne.edu</a><br>
--000e0cd598dad02e4904769ce179--
--===============3763713501635853728==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
--===============3763713501635853728==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Boa-constructor-users mailing list
Boa-constructor-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/boa-constructor-users
--===============3763713501635853728==--