![Image](images/myimg/postimg/widget/1a.jpg)
Fig.1. A widget generated near a textured object.
The cuboid (colored yellow and green) is a widget generated by the script. User can roll the texture (i.e. change offset) interactively by dragging a yellow face, and can scale the texture (i.e. change number of repeat) by green.
![Image](images/myimg/postimg/widget/2a.jpg)
Fig.2. Scaled texture
![Image](images/myimg/postimg/widget/3a.jpg)
Fig.3. Rolled texture
The script registers some functions written in itself as callback functions for widgets in order to catch user events (selection, dragging, hovering, etc.) as with the original C++ sample code, and generates a message box to pause the main flow in order to end itself.
![Image](images/myimg/postimg/widget/4a.png)
Fig.4. Structure of the callback functions
Please compare the script with the original SDK sample C++ code and read classes defined in ptsxpydef1.py to understand hierarchical callbacks if needed.
Note
(1) Original issues
The original API sample C++ code does not respond to every situation. This script inherits that, and tS often crashes as in the C++ sample.
(2) Blocking by the message box
While the message box is living (in the back side of tS), some user operations to tS (e.g. Render Scene, selecting a shader, terminating tS, etc.) are blocked. Please keep in mind that till you close the box.
![Image](images/myimg/postimg/_ver_icon/py3_a.png)
![Image](images/myimg/postimg/_ver_icon/py2_a.png)
![Image](images/myimg/postimg/_ver_icon/ts43_a.png)
![Image](images/myimg/postimg/_ver_icon/ts51_a.png)
![Image](images/myimg/postimg/_ver_icon/ts60_a.png)
![Image](images/myimg/postimg/_ver_icon/ts66_a.png)
![Image](images/myimg/postimg/_ver_icon/ts7_a.png)