Table Inspector
Posted: 29 Aug 2009, 15:50
I wrote this years ago to help me debugging IceUI. Now I decided to share it with all my fellow widget developers.
It registers a global WG.Inspect(table) function that will render the given table as shown in this screenshot:
You can click on nearly all values to do stuff. Subtables will be inspected using the same method, functions will be called (no parameters possible atm though; it then shows if the call was successful and a table with the return values or the error message), bools will be toggled, strings and numbers will be opened in a little popup to show the actual number (not rounded to three digits) or in case the text is to long to be readable in the inspector.
You can scroll using the "Scroll up" and "Scroll down" buttons or simply by using the mouse wheel.
The back button is just like in a browser. It takes you to the previous view.
All the other buttons are shortcuts to tables. WM is IceUIs window manager, the profile buttons are for profiling IceUI code (needs to be enabled first). The only button useful for you is probably "Widgets" which shows all activated widgets (inspectable).
It's also nice to inspect UnitDefs or the Spring table to have a list of all callouts.
If you don't have IceUI, just download the attached archive and extract it into your widgets directory. Then use WG.Inspect(table) in your widget.
If you already have IceUI, enable debugMode.debugMode in gui_IceUI.lua line 47, press F11 ingame and select "Inspector" under "IceUI Windows". If you can see the window onscreen, you can start calling WG.Inspect(table) in your own widget.
It will also recheck the table every few seconds for any changes and will update the view.
Please let me know if you were able to use this and if you have any suggestions.
It registers a global WG.Inspect(table) function that will render the given table as shown in this screenshot:
You can click on nearly all values to do stuff. Subtables will be inspected using the same method, functions will be called (no parameters possible atm though; it then shows if the call was successful and a table with the return values or the error message), bools will be toggled, strings and numbers will be opened in a little popup to show the actual number (not rounded to three digits) or in case the text is to long to be readable in the inspector.
You can scroll using the "Scroll up" and "Scroll down" buttons or simply by using the mouse wheel.
The back button is just like in a browser. It takes you to the previous view.
All the other buttons are shortcuts to tables. WM is IceUIs window manager, the profile buttons are for profiling IceUI code (needs to be enabled first). The only button useful for you is probably "Widgets" which shows all activated widgets (inspectable).
It's also nice to inspect UnitDefs or the Spring table to have a list of all callouts.
If you don't have IceUI, just download the attached archive and extract it into your widgets directory. Then use WG.Inspect(table) in your widget.
If you already have IceUI, enable debugMode.debugMode in gui_IceUI.lua line 47, press F11 ingame and select "Inspector" under "IceUI Windows". If you can see the window onscreen, you can start calling WG.Inspect(table) in your own widget.
It will also recheck the table every few seconds for any changes and will update the view.
Please let me know if you were able to use this and if you have any suggestions.