SMath Studio Forum
»
SMath Studio
»
Questions
»
Form running on worker thread and not main thread
Rank: Member Groups: Registered
Joined: 10/04/2023(UTC) Posts: 22 Was thanked: 15 time(s) in 7 post(s)
|
Hello everyone, I am currently working on the maxima plugin (bug fixing etc.). One of the bugs I'm currently focusing on involves locating the Maxima executables within the plugin. In the plugin there is a form that allows users to search for the Maxima folder when the maxima executable is not found, but I have encountered an unexpected behavior during testing. For users who have freshly installed the plugin and try to execute any Maxima command, the form appears automatically for less than a second and then automatically closes. This indicates that the form is running on a different thread, separate from the main thread (from my understanding and testing using debugger). Is it possible to access the main thread (the UI thread) in SMath? Maybe something like but I am not sure if that is an option for this case. I am relatively new to this project therefore I'm seeking some guidance and examples on how to achieve this. Currently, the code responsible for executing the form is as follows: Code:public void foundNoPath()
{
if (SharedFunctions.initializingOverMenue) return;
DialogResult result2 = MessageBox.Show(
"Cannot find maxima.bat. Do you want to enter a start search path now?",
"Cannot find maxima.bat",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.ServiceNotification);
if (result2 == DialogResult.Yes)
{
//this is where the mentioned form is executed
MForms.SettingsForm sf = new MForms.SettingsForm();
sf.Show();
}
}
Please note that this code is only executed when initiating a new Maxima session, and according to my observations using the debugger, it appears to be executed by one of the worker threads instead of the main thread. I would greatly appreciate it if anyone could provide me with examples or suggestions. Thank you all in advance for your support and assistance. Regards, Edited by user 28 May 2023 00:28:31(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Hello, I' m not sure if it is the same issue but I guess you can try with the save dialog approach for XeLaTeX documents, code is here, starting from line 99. feel free to ask if you need further help and thank you for your efforts to improve this plugin . Edited by user 28 May 2023 12:23:32(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Form running on worker thread and not main thread
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.