I develop and maintain uptodate 11 applications with Xojo. I’m using MacOs but some of them run under window.
I began some of them myself and I continue others which were began by a friend of me (who made me discover RealBasic).
My Apps used App.DoEvents and I just finish to remove them all. I finished my last app yesterday evening. I use Thread and/or Timer to do so.
But I don’t ask Xojo to remove this instruction, It’s a lot of work and everyone should do as he want, use it or not. We just have to know we shouldn’t.
I could review all my code because My previous Boss kick me out. We were 3 guys commercials in all The France for 9 years. Our Boss asked us to find dealers to sell his stoves. We didn’t earn a lot when we started but he said us that it will be better in 8 years when we will have found dealers. After an hard work wee will just have to maintain the turnover of dealers nd our work will be easiest. We were exactly in the progression he asked us when he summoned us, and he told us that now he have enough dealers and he doesn’t need us anymore.
The positive things is I could review my programs.
Last thing, I remark that access to a BevelButtun.Value in a Thread doesn’t make a ThreadAccessUIException .
Do : MyFlag = MyBevelButton.Value in a Thread and all works fine.
I suppose it shouldn’t, if Xojo doesn’t allow us to access UI from a thread it’s because there is a good reason, it’s not only to annoy us.
Its more about changing the UI in a thread.
The value of a button can be read without breaking anything… seems reasonable that you should be able to access it.
I did test, if I read the state of a CheckBox.Value, or if I read a TextField.Text or a PushButton.Caption, all return a bug ThreadAccessUI exception.
I didn’t try to write the state ov BevelBurton.Value, I will try it.
[quote=358655:@Thomas ROBISSON]I did test, if I read the state of a CheckBox.Value, or if I read a TextField.Text or a PushButton.Caption, all return a bug ThreadAccessUI exception.
I didn’t try to write the state ov BevelBurton.Value, I will try it.
I forget to mention I use the last Xojo version.[/quote]
Reading UI items from a thread would be the same as Writing them from a Thread. Don’t do it even if it works.
Your better off making a global property or so and or get set that on the checkbox.action/change event and in checkbox.open
Then read/write the property from the thread.
Yes yes, it was a mistake and I forgot to change a instruction If MyBevButton.Value Then → If MyBevButtVal Then like I did everywhere else. I saw it because I had a trouble with the line code just above. I corrected it but I’m surprise that Xojo didn’t alert me.
I jus did the test, I have a ThreadAccessUIException if I change the state of a BevelButton in a Thread.
I think I should fill a FeedBack as Xojo should display an alert.
[quote=358660:@Thomas ROBISSON]Yes yes, it was a mistake and I forgot to change a instruction If MyBevButton.Value Then → If MyBevButtVal Then like I did everywhere else. I saw it because I had a trouble with the line code just above. I corrected it but I’m surprise that Xojo didn’t alert me.
I jus did the test, I have a ThreadAccessUIException if I change the state of a BevelButton in a Thread.
I think I should fill a FeedBack as Xojo should display an alert.
Edit : I did a FeedBack : <https://xojo.com/issue/50331>.[/quote]
There are (basic-like) languages that actually allow for a Thread-Safe setting, giving you the an option to allow for code and ui-sharing within a thread. Not sure why Xojo doesn’t have this. Those languages probably do something special behind the scenes as they report the -running code speed might be a little slower-. Still development would be way faster…