ok so i've fixed that part, now here is some added
problem:
The contents of the wxGrid are not known until runtime
the number of rows and columns are determined from
other program data. (from data receive from serial
port to be specific)
1.how am i going to set my wxGrid to just add rows and
columns as long as there are data read.
2.if i am to make a new wxGrid periodically (that is i
am going to delete the contents of the old wxGrid, say
every 5 minutes, then put in new data starting from
the first row again, would it be automatically show
the first row? (i mean would the grid browse up since
the last entry would be in row 1XXXX, and that is way
down below)
thanks for the help...
···
--- Peter Damoc <pdamoc@gmx.net> wrote:
On Tue, 29 Mar 2005 18:13:28 +0300, jan rienyer > gadil > <jrlen97_2@yahoo.com> wrote:
> i've added a wxGrid to my program. now i am having
trouble in setting
> the value of the cells in the grid.
> this is what i've done:
> data1 = float(byte[k+3])* 5/255
> data2 = float(byte[k+4])* 5/255
> data3 = float(byte[k+5])* 5/255
> data4 = float(byte[k+6])* 5/255
> data5 = float(byte[k+7])* 5/255
> data6 = float(byte[k+8])* 5/255
>
> self.grid1.SetCellValue(str(data1), self.count, 0
)
> self.grid1.SetCellValue(str(data2), self.count, 1
)
> sellf.grid1.SetCellValue(str(data3), self.count, 2
)
> self.grid1.SetCellValue(str(data4), self.count, 3
)
> self.grid1.SetCellValue(str(data5), self.count, 4
)
> self.grid1.SetCellValue(str(data6), self.count, 5
)
> but i am having an error that says:
>
> Traceback (most recent call last):
>
> File "E:\GUICode\Folder1\wxFrame1.py", line 496,
in OnStartButton
>
> self.grid1.SetCellValue(str(pyra11), self.count, 0
)
>
> File
"C:\PYTHON23\Lib\site-packages\wxPython\grid.py",
line 1439, in
> SetCellValue
>
> val = gridc.wxGrid_SetCellValue(self, *_args,
**_kwargs)
>
> TypeError: an integer is required
> How am i going to do this???from wxDocs:
wxGrid::SetCellValue
void SetCellValue(int row, int col, const wxString&
s)so you see... first comes the row, then the col and
only the third is the
value.
maybe it should have been like:
self.grid1.SetCellValue(self.count, 0 , str(data1))--
Peter Damoc
Warrior Of The Light
http://www.sigmacore.net/
---------------------------------------------------------------------
To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/