MOHO.UpdateTable
Moderators: Víctor Paredes, Belgarath, slowtiger
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
MOHO.UpdateTable
Please someone explain what is MOHO.UpdateTable?
- hayasidist
- Posts: 3841
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: MOHO.UpdateTable
https://mohoscripting.com/lm_utilities catalogues the functions in LM_Utilities. One function is MOHO.RunUpdateTable(moho). This function takes the table MOHO.UpdateTable and calls each function that is held in the table. For all practical purposes, it should be regarded as internal to Moho. Specifically, there is no way to provide any parameters to the called functions.
Re: MOHO.UpdateTable
I would say prior to Moho 14 it was pretty useless. But now that we have access to ScriptInterfaceHelper/MohoObject() - you can access practically anything.
So if you are running Modeless Dialogs, then you can effectively set up a callback to refresh the dialogs etc automatically on Frame, Layer, Document, Selected Items change etc etc.
One thing to note: It gets called a lot. So you have to do a bit of defensive programming to stop it wasting CPU for no reason.
So if you are running Modeless Dialogs, then you can effectively set up a callback to refresh the dialogs etc automatically on Frame, Layer, Document, Selected Items change etc etc.
One thing to note: It gets called a lot. So you have to do a bit of defensive programming to stop it wasting CPU for no reason.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
Re: MOHO.UpdateTable
Well, I'm little bit confused about it, would you please show me a working useful example?
Re: MOHO.UpdateTable
The simplest example is calling UpdateWidgets() for a non-modal dialog when changing the frame or layer.
Re: MOHO.UpdateTable
A practical example is presented below in the SS Point Info Panel, which presents information on selected points and updates the dialog when that selection/info changes. It has some built-in updates defense - as it is set ignore frequent update calls - and calls other than for Doc,Layer, Point Selection changes.

https://drive.google.com/file/d/19sTvzb ... sp=sharing
In an ideal world - you would be able to register in the Update Table for specific events - rather than being called for practically everything that changes.

https://drive.google.com/file/d/19sTvzb ... sp=sharing
In an ideal world - you would be able to register in the Update Table for specific events - rather than being called for practically everything that changes.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
Re: MOHO.UpdateTable
Great example! thanks!
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact: