[Gambas-user] Getting wrong text item from listtview

richard terry rterry at ...1822...
Mon Apr 7 00:14:28 CEST 2008


On Mon, 7 Apr 2008 06:46:18 am jbskaggs wrote:
> I dont know why i keep having new listview bugs pop up.  But this time I
> keep getting the firstitem's text in a listviewreference that everywhere
> else is pointing to the right listview item.
>
> listview1_click() points and displays the right listview.item text
> then when it goes to listview2_click is references the right item on
> listview one
> then when I click my listview2menu to edit a text file it edits the file
> and saves with the right path (listview1.item.text
> &/listview2.item.text&/"filename.txt"
>
> but when I goto edit same file it always calls the first listview1.item in
> the path and can't find the file.  I have scoured the code to find where I
> am reassigning the variable or moving the cursor and I am not finding it.
>
> Is there a trick to finding the bug?
>
> JB Skaggs

Don't forget to always do a movecurrent before you read the value of the text. 
Perhaps that will help. Did you do that. I got caught quite a few times till 
I was meticulous about it.

BTW contrary to what someone said on a previous post  (I think, apologies to 
the writer if my memory is wrong) , the _Selected and _Click events do 
different thinks.

 If you move up and down a list the _Selected event always fires but the Click 
doesn't. You can move your internal cursor to the .movecurrent during the 
_selected event, that way if the user does click on it, it will get the 
correct value.

Hope this isnt too confusing.

Richard


Richard





More information about the User mailing list