[Gambas-user] Table view questions

Eilert eilert-sprachen at ...221...
Fri Sep 10 09:52:50 CEST 2004


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?

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:

	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)

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.

Or is this not the way you were thinking of? At least the DataReport 
example seems to handle it this way...

Rolf





More information about the User mailing list