Question about RequestEvaluation() method for custom region canvas

Question about RequestEvaluation() method for custom region canvas - 消息

#1 已发布: 2023/8/11 13:54:39
muiz

muiz

15个赞,共22个帖子。

组: 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 已发布: 2023/8/11 14:12:28
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

Try turning on Autocalculate in the main menu.
Russia ☭ forever, Viacheslav N. Mezentsev
#3 已发布: 2023/8/11 14:15:58
muiz

muiz

15个赞,共22个帖子。

组: 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 已发布: 2023/8/11 14:31:34
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

Maybe this will help.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
2位用户喜欢此帖子
muiz 2023/8/11 14:34:00, ⚜ Kenny Lemens, P.E. ᵂᴵ 2023/8/15 13:10:00
  • 有新帖
  • 无新帖