I’m having a problem that can not detect the subject, explain, in one of my projects I have a listbox (super: VolumeBrowser) sometimes but very sporadically when I click (mouse down) the item is not selected and also "runs "down or up in the list for other item, I think it’s a bug because it just started happening in 2015r1, anyone has seen this and any solution exist ?
Then my best guess is it’s some bug in your code. I use the Listbox extensively in various ways and have never seen anything like that. Are you setting Selected in MouseUp or MouseDown or something like that?
everytime you got something strange, try strange things.
For example, create a new user (in your computer), copy the application and make tests there.
Or: install Xojo in this new user, load the project, build the application and test both run in the IDE and run the Stand Alone.
Or: do the same on an external hard disk
Or: make the same in another computer that is used for this (only, more or less).
This may let you know if your boot volume have trouble(s) for whatever reason (mass storage troubles, applications collisions, whatever) or not.
A cold boot may also help as adding useless code in the offending code location (or removing commented lines) but there, we are approaching Halloween debugging ;- [nota: this sometimes works for me :(]
everytime you got something strange, try strange things.
For example, create a new user (in your computer), copy the application and make tests there.
Or: install Xojo in this new user, load the project, build the application and test both run in the IDE and run the Stand Alone.
Or: do the same on an external hard disk
Or: make the same in another computer that is used for this (only, more or less).
This may let you know if your boot volume have trouble(s) for whatever reason (mass storage troubles, applications collisions, whatever) or not.
A cold boot may also help as adding useless code in the offending code location (or removing commented lines) but there, we are approaching Halloween debugging ;- [nota: this sometimes works for me :(][/quote]
Emile Schwarz all that I have done, this project is running to two years in more than 15 machines and only after 2015 r1 started happening when I was in Carbon and earlier versions did not, actually already went over everything and do not think explanation for this, becauseIt happens from time to time only!
The random nature of the bug could be due to a sporadic lack of sync between your code and the state of the listbox. In other words, that when your code executes, for some reason the listbox is still busy scrolling. Could it be due to the Magic Mouse ? Theoretically, it could start a scroll just before the click, or do it right after, when the finger lifts.
I would try to use a 50-250 ms single timer in keydown which does the select in its action, and while there, set ScrollPosition again in case the listbox has scrolled. That may go around the bug.
[quote=219419:@Michel Bujardet]The random nature of the bug could be due to a sporadic lack of sync between your code and the state of the listbox. In other words, that when your code executes, for some reason the listbox is still busy scrolling. Could it be due to the Magic Mouse ? Theoretically, it could start a scroll just before the click, or do it right after, when the finger lifts.
I would try to use a 50-250 ms single timer in keydown which does the select in its action, and while there, set ScrollPosition again in case the listbox has scrolled. That may go around the bug.[/quote]
Hello Michel, Tanks for your help !
His approach is really interesting, I believe it is not due to Apple MagicMouse because of the 15 machines that have the program, 5 has this mouse, anyway I've been testing on my Macbook Air and I can not reproduce the error almost never but I impression is it has something to do with the Global Floating window in COCOA always loses focus, which was not the case with Carbon.
I came to this theory because it has a textfield that only gets focus if I click on it 2 times (not double click) I have to click, wait one second and click again, then it seems that the window comes into focus again despite already be floating on the other top bar looks like inactive.
[quote=219549:@Paulo Vargas]Hello Michel, Tanks for your help !
His approach is really interesting, I believe it is not due to Apple MagicMouse because of the 15 machines that have the program, 5 has this mouse, anyway I've been testing on my Macbook Air and I can not reproduce the error almost never but I impression is it has something to do with the Global Floating window in COCOA always loses focus, which was not the case with Carbon.
I came to this theory because it has a textfield that only gets focus if I click on it 2 times (not double click) I have to click, wait one second and click again, then it seems that the window comes into focus again despite already be floating on the other top bar looks like inactive.[/quote]
You may want to add
Self.Show
in the MouseDown event of the floating window for it to gain focus at the first click.
[quote=219584:@Michel Bujardet]You may want to add
Self.Show
in the MouseDown event of the floating window for it to gain focus at the first click.[/quote]
Michel Bujardet Tanks, will try this approach too, will only have a return to improved next week when I will ask for the test operators, there will try it and think of some things, kkk