In front, we can see the picture of the flash screen , The menu display in the lower half of the flash screen has been analyzed , It displays menu resources from python Code , In this way , You can not modify C Code , You can modify the composition of the menu . To achieve this function , It's a complicated process , If you want to integrate this function into your software , Just look at this article , You can refer to blender How to achieve it . Of course , This article is just a lead , The general research direction is introduced , If you need to study deeply , I have to study it myself blender Source code , To steal some blender Code into your own project , Such a development method must be much faster , At least it's a big victory faster than studying without direction , After all, open source “ teacher ” Is a powerful foreign aid .
This article continues from the previous article python Script wm.py, It defines the display contents and operation actions of the menu . The previous analysis shows how to display this menu , Now let's analyze how it is loaded into memory , In order to show . From the previous analysis, we can see that , It saves a menu resource HASH table , Then find out from the inside , The code is as follows :
The code uses menutypes_hash To represent saving HASH Variable , Use WM_menutype_find Function to find the corresponding menu resource . Now we will ask how to make the menu