[Gambas-user] Table view questions
Benoit Minisini
gambas at ...1...
Fri Sep 10 10:25:58 CEST 2004
On Friday 10 September 2004 09:52, Eilert wrote:
> Hi Benoit,
>
> >>The tableview in Gambas seems to be able to do that, but there must be a
> >>simple way of putting the text into the cells.
> >
> > No simple way. But it is not so hard... It is just a matter of habit :-)
>
> Ok, I found a way of filling individual cells with text and color - but
> is this really the way you intended it to work?
Yes.
>
> First, you've got to "build" a Data event for the tableview by hand,
> typing (when tb == tableview)
>
> public sub tb_Data(row as integer, column as integer)
>
> 'and then you have to make sure to catch the correct cell number
> 'for example:
Of course, you should optimize this test as much as possible.
>
> if row = 1 and column = 1 then
> tb.Data.Text = "hello"
> tb.Data.BackColor = &H00FF00&
> end if
>
> end
>
> You will then have to trigger that event from somewhere else, calling it
>
> tb_Data(1,1)
???? You should never call the Data event handler yourself.
>
> while the values you give there are of no meaning - the tableview will
> always read in all values for all cells at a time - but you must give
> values because otherwise Gambas will complain.
Sorry, I don't understand your sentence...
>
> Or is this not the way you were thinking of? At least the DataReport
> example seems to handle it this way...
>
> Rolf
>
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list