Scripting-Driven UI Event Loop for Cross-Platform Frame Refresh
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current UI frameworks lack support for both scripting languages and frame refreshing, with IMGUI not supporting scripting languages well and Electron primarily focusing on event-driven non-frame refreshing scenarios.
Innovation Solution
A method and system utilizing an event loop mechanism to periodically acquire and process user interface events using a scripting language, enabling frame refreshing while supporting cross-platform functionality and personalized processing for different operating systems.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If IMGUI is used for real-time rendering UI, then frame refreshing capability is achieved, but scripting language support is poor
Solution Approach 1:
The system is divided into distinct modules: an event loop mechanism for frame management, a scripting language interpreter for code processing, and an event processing system. This segmentation allows each component to specialize in its function while working together to achieve both frame refreshing and scripting support.
Solution Approach 2:
An event loop mechanism serves as an intermediary between the scripting language processing and the frame rendering system. It periodically processes events from the scripting layer and triggers frame refreshing, bridging the gap between event-driven scripting and real-time rendering requirements.
2Ease of manufacture
If Electron is used for UI framework, then scripting language support is provided, but frame refreshing capability is limited
Solution Approach 1:
The event loop mechanism implements periodic action by continuously cycling through event processing phases at fixed intervals. This periodic execution ensures that scripting events are processed regularly while maintaining a predictable frame refresh rate, combining the benefits of event-driven programming with real-time rendering capabilities.
3Adaptability or versatility
If cross-platform compatibility is implemented, then adaptability to different operating systems is improved, but system complexity increases
Solution Approach 1:
The event loop mechanism and event processing system are designed with universality, handling multiple types of events (mouse, keyboard, touch, etc.) through a unified interface. This allows the same core system to operate across different operating systems without requiring platform-specific implementations, reducing overall system complexity while maintaining cross-platform compatibility.
Data Source
AI summary
The present application relates to a method, system, electronic device, medium and program product for user interface processing, which are applied in the field of computer technology. The present disclosure enables: periodically acquiring user interface events for a target application based on an event loop mechanism; using a scripting language, processing the user interface events acquired in each period to perform frame refreshing on the user interface of the target application.


