Question about RequestEvaluation() method for custom region canvas

Question about RequestEvaluation() method for custom region canvas - Сообщения

#1 Опубликовано: 11.08.2023 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 Опубликовано: 11.08.2023 14:12:28
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Try turning on Autocalculate in the main menu.
Russia ☭ forever, Viacheslav N. Mezentsev
#3 Опубликовано: 11.08.2023 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 Опубликовано: 11.08.2023 14:31:34
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Maybe this will help.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
muiz 11.08.2023 14:34:00, ⚜ Kenny Lemens, P.E. ᵂᴵ 15.08.2023 13:10:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений