[Gambas-user] New treeview is getting a little bit overexcited

Benoît Minisini gambas at ...1...
Mon Nov 5 00:14:11 CET 2012


Le 04/11/2012 23:33, Bruce a écrit :
> On Sun, 2012-11-04 at 14:35 +0100, Benoît Minisini wrote:
>> Le 04/11/2012 11:54, Bruce a écrit :
>>> This used to work
>>>           tvwJockeys.Add(Subst("R&1#&2", cs.RaceNo, cs.BP),
>>>           Subst("(R&2 ... #&3) &1", cs.HorseName, cs.RaceNo, cs.TabNo),,
>>>           cs.Jockey)
>>>
>>> OK, I'll simplify :-)
>>>
>>>           tvwX.Add(somekey, sometext,,parent)
>>>
>>> no Picture, no After.
>>>
>>> Now I get a "null object" error.  I think its due to the empty parameter
>>> [Optional Picture as Picture]?  ... because every other cs.something is
>>> valid.
>>>
>>   > ...
>>   >
>>
>> tvwX.Add(somekey, sometext,,parent)
>>
>> is perfectly valid.
>>
>> So you must give me more information about where you get a null error.
>> Ensure that cs is not null before calling tvwJockeys.Add(), to find what
>> is null exactly.
>>
>> Regards,
>>
>
> Hi Benoît,
>
> After a bit of tracking it down, the null object is at line 109 in
> _Treeview:
>
>
> Public Sub _SortParent(sKey As String)
>
>    If sKey Then
>      $cSort[sKey] = True                   <-------!!!!
>    Else
>      $bSortRoot = True
>    Endif
>    If Not $hSortTimer Then
>      $hSortTimer = New Timer As "Sort"
>      $hSortTimer.Trigger
>    Endif
>
> End
>
> The null object is $cSort.
>
> The problem arises on the second time the treeview is loaded, not the
> first.
>
> I hacked the FTreeview class a bit in gb.gui.base to demonstrate. It is
> attached.
>
> Basically, I added a "Refresh" button that clears and reloads the tree
> (and there are a few debug messages still hanging around in it).
>
> When the program starts, the treeview is loaded properly, but when the
> Refresh button is clicked the null object occurs.
>
> regards
> Bruce
>

These problems should be solved by revision #5300.

Regards,

-- 
Benoît Minisini




More information about the User mailing list