wxgrid problem

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) :slight_smile:

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/

Hi Jan,

Check out the wiki for grid, i.e.:

http://wiki.wxpython.org/index.cgi/UpdatingGridData

See you
Werner

jan rienyer gadil wrote:

···

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) :slight_smile:

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/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

sir, what could be the meaning of this error i am getting everytime i run my program:

wxPython.wxc.wxPyAssertionError: C++ assertion “wxAssertFailure” failed in e:\Projects\wx2.4\src\generic\grid.cpp(3103): invalid row or column index in wxGridStringTable

here is the complete error:

Traceback (most recent call last):

File “E:\GUICode\Folder3\wxFrame1.py”, line 480, in OnStartButton

self._reader = threading.Thread(target=self._Reader())

File “E:\GUICode\Folder3\wxFrame1.py”, line 507, in _Reader

self.grid1.SetCellValue(self.rowCount, 0, str(self.pyra11))

File “C:\PYTHON23\Lib\site-packages\wxPython\grid.py”, line 1439, in SetCellValue

val = gridc.wxGrid_SetCellValue(self, *_args, **_kwargs)

wxPython.wxc.wxPyAssertionError: C++ assertion “wxAssertFailure” failed in e:\Projects\wx2.4\src\generic\grid.cpp(3103): invalid row or column index in wxGridStringTable

···

“Werner F. Bruhin” werner.bruhin@free.fr wrote:

Hi Jan,

Check out the wiki for grid, i.e.:

http://wiki.wxpython.org/index.cgi/UpdatingGridData

See you
Werner

jan rienyer gadil wrote:

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) :slight_smile:

thanks for the help…

— Peter Damoc wrote:

On Tue, 29 Mar 2005 18:13:28 +0300, jan rienyer > >>gadil > >> 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
&gt
;

)

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/


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail
:
wxPython-users-help@lists.wxwidgets.org


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!

Hi Jan,

Either your row or column index is invalid.

From the traceback below I would guess that "self.rowCount" contains something the grid does not like. Maybe an int larger then the current size of the grid - haven't worked much with grids so don't know what it would do in that case.

See you
Werner

jan rienyer gadil wrote:

···

sir, what could be the meaning of this error i am getting everytime i run my program:

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in e:\Projects\wx2.4\src\generic\grid.cpp(3103): invalid row or column index in wxGridStringTable

here is the complete error:

Traceback (most recent call last):

File "E:\GUICode\Folder3\wxFrame1.py", line 480, in OnStartButton

self._reader = threading.Thread(target=self._Reader())

File "E:\GUICode\Folder3\wxFrame1.py", line 507, in _Reader

self.grid1.SetCellValue(self.rowCount, 0, str(self.pyra11))

File "C:\PYTHON23\Lib\site-packages\wxPython\grid.py", line 1439, in SetCellValue

val = gridc.wxGrid_SetCellValue(self, *_args, **_kwargs)

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in e:\Projects\wx2.4\src\generic\grid.cpp(3103): invalid row or column index in wxGridStringTable

*/"Werner F. Bruhin" <werner.bruhin@free.fr>/* wrote:

    Hi Jan,

    Check out the wiki for grid, i.e.:

    http://wiki.wxpython.org/index.cgi/UpdatingGridData

    See you
    Werner

    jan rienyer gadil wrote:

    >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) :slight_smile:
    >
    >thanks for the help...
    >
    >--- Peter Damoc wrote:
    >
    >>On Tue, 29 Mar 2005 18:13:28 +0300, jan rienyer > >>gadil > >> 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/
    >
    >---------------------------------------------------------------------
    >To unsubscribe, e-mail:
    wxPython-users-unsubscribe@lists.wxwidgets.org
    >For additional commands, e-mail:
    wxPython-users-help@lists.wxwidgets.org
    >

    ---------------------------------------------------------------------
    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://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/resources/&gt;