[Gambas-user] Table view

Doriano Blengino doriano.blengino at ...1909...
Tue Oct 14 22:18:38 CEST 2008


Almanova Sistemi ha scritto:
> Stefano Palmeri ha scritto:
>   
>> TableView1.Rows.Height = 2000
>>     
> Ok,
>  I have tried with your instuction during TableView_Data event and I get
> a "Stack Overflow" messages.
>
> Why?
>   
...because, apparently, changing the height of a row makes the tableview 
think it needs data again, so it fires a data event, which changes 
height, wich fires data event, which... ...fills up the stack.

One way to avoid this is to use a lock variable:

    private dontreenter as boolean

    public sub TableView_data(...)

      if dontreenter then return
      dontreenter = true
      ...
      ...
      dontreenter = false
    end sub


Take care to reset dontreenter in every occasion you exit the xxx_data() 
event handler.

Have fun with the stack...

Ciao,
Doriano






More information about the User mailing list