Question about RequestEvaluation() method for custom region canvas

Question about RequestEvaluation() method for custom region canvas - Messages

#1 Posted: 8/11/2023 1:54:39 PM
muiz

muiz

15 likes in 22 posts.

Group: User

Hello everyone,

I have a question about updating the custom region canvas. Currently the image generation and processing for Insert > Draw2D / Draw3D in Maxima plugin inherit the RegionHolder class such that:
public class MaximaPluginRegion : RegionHolder<MaximaPluginCanvas> {}


Currently the image in the region/canvas update itself based on the OnEvaluation method, as shown in the image below. The important part here is the canv.Plot() as new image is generated and processed through this function. Now I have a windows form which has the access to this MaximaPluginRegion class and want to update the canvas by making the evaluation when the user click on a button or action is made. However when using the RequestEvaluation() and Invalidate() methods, nothing happened. Any idea on how the RequestEvaluation() actually works or how can I make the evaluation? I have tried to call the canv.Plot() directly when user click the button, however this will cause the GUI to stuck because the main thread is still in use to do some process and the GUI cannot update itself.

Screenshot_549.png

Thank you in advance.


Best regards,

Faiz

#2 Posted: 8/11/2023 2:12:28 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Try turning on Autocalculate in the main menu.
Russia ☭ forever, Viacheslav N. Mezentsev
#3 Posted: 8/11/2023 2:15:58 PM
muiz

muiz

15 likes in 22 posts.

Group: User

Wrote

Try turning on Autocalculate in the main menu.




I did and nothing happened when the RequestEvaluation is called. Does calling the RequestEvaluation will call again the method OnEvaluation or is it calling something else?
#4 Posted: 8/11/2023 2:31:34 PM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Maybe this will help.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
2 users liked this post
muiz 8/11/2023 2:34:00 PM, ⚜ Kenny Lemens, P.E. ᵂᴵ 8/15/2023 1:10:00 PM
  • New Posts New Posts
  • No New Posts No New Posts