New topic: 

ListBox doubleclick not working

<http://forums.realsoftware.com/viewtopic.php?t=47707>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        plunkettphoto          Post subject: ListBox doubleclick not 
workingPosted: Thu Apr 25, 2013 8:47 pm                                 
Joined: Fri Oct 10, 2008 7:14 pm
Posts: 89                Dim row,column as Integer
row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - Me.Top - 
Self.Top)
column=Me.ColumnFromXY(System.MouseX - Me.Left - Self.Left, System.MouseY - 
Me.Top - Self.Top)
MsgBox "You double-clicked in cell "+Str(row)+", "+Str(column)


I copied this code directly out of the Library Reference for ListBox to 
determine which cell was double clicked.

I click the 3rd or 4th row of the ListBox and both row and column return -1

I have tried compiling both as Carbon and Cocoa - I'm running OS X of course 
Mountain Lion.  Seems like I have made this work before so what am I doing 
wrong.   
                             Top                timhare          Post subject: 
Re: ListBox doubleclick not workingPosted: Thu Apr 25, 2013 11:10 pm            
             
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12262
Location: Portland, OR  USA                Depending on where this code is, 
"self" could be either the window (correct) or the listbox.  This code will not 
work as part of a listbox subclass, it must be in the event code editor in the 
window.  Also, it won't work as part of a containercontrol.   
                             Top                plunkettphoto          Post 
subject: Re: ListBox doubleclick not workingPosted: Fri Apr 26, 2013 8:51 am    
                             
Joined: Fri Oct 10, 2008 7:14 pm
Posts: 89                It's in the DoubleClick event of the Listbox control.  
No subclasses, the super is listed as Listbox.  There are 3 columns in the list 
and the method to populate it works fine.

The code is right out of the Listbox control in the Language Reference and 
placed where it said to place it.

I really do appreciate the reply and all the help to be had here.  But I still 
am not sure what's going on...

thanks
b   
                             Top                plunkettphoto          Post 
subject: Re: ListBox doubleclick not workingPosted: Fri Apr 26, 2013 9:08 am    
                             
Joined: Fri Oct 10, 2008 7:14 pm
Posts: 89                Ok, Tim's reply didn't help on the surface but it did 
get me looking at some other implications of what was said.  Turns out the 
problem was in the PopulateListBox method I wrote which contained an error that 
apparently corrupted the listbox.

Anyway, thanks for getting me on the right train....

b   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to