[Gambas-user] Program producing constant load

Benoît Minisini g4mba5 at gmail.com
Fri Apr 1 00:52:42 CEST 2022


Le 01/04/2022 à 00:30, T Lee Davidson a écrit :
> On 3/31/22 06:56, Rolf-Werner Eilert wrote:
>> Here is a special version Kalender4-Test which uses a special 
>> directory for its calendar data and should run on other systems too.
>>
>> You need the archive and the kaltes.tar.gz of the special directory. 
>> Unpack or copy the latter to your $home as $home/.kalendertest/... It 
>> contains only holiday data, everything else is left out, but it runs 
>> this way and maybe shows the problem.
>>
>> Hope this helps!
>>
>> Regards
>> Rolf
> 
> The problem is at lines 915, 997, and 1044, in the kalMonat 1-3 _Data 
> event handlers:
> If Column = 0 Then .Rows[Row].Text = KW   'Kalenderwoche
> 
> I am not certain (someone with greater knowledge of the event loop than 
> me would need to confirm), but I suspect that setting the cell's text 
> outside of the .Data property is causing the _Data event handler to be 
> called recursively.
> 
> Is it possible to set the row header text in the AnzeigeDatum subroutine?
> 

Technically, not directly. The Data is used by the control to retrieve 
the contents of a specific cell.

Consequently, you must not trigger a refresh of that same cell inside 
its Data event handler, directly or indirectly, otherwise you generate 
successive calls of Data and refreshes forever.

Otherwise, setting the text of a row will trigger a refresh, which will 
call the Data event handler for the cells that must be redrawn.
  Regards,

-- 
Benoît Minisini


More information about the User mailing list