@@ -80,6 +80,7 @@ Tools and dependencies.
8080- Avoid heavy work in ` __init__ ` to keep loading fast.
8181- Wire signals locally and use ` gui.log.append(...) ` for logs.
8282- If your engine tab becomes large, wrap it in a scroll area so the UI stays usable.
83+ - Prefer shared UI helpers from the SDK for common patterns (icon selector, output dir, checkbox rows).
8384
8485** Monolithic Tab Example**
8586The following dummy engine shows how to build a very large UI tab with a scroll area to keep it usable.
@@ -176,6 +177,30 @@ class MonolithicEngine(CompilerEngine):
176177 if getattr (self , " _output_dir" , None ):
177178 self ._output_dir.setText(" " )
178179```
180+
181+ ** SDK UI Helpers**
182+ Use the shared helpers to reduce duplication across engines.
183+ ``` python
184+ from engine_sdk import add_form_checkbox, add_icon_selector, add_output_dir
185+
186+ # Inside create_tab(...)
187+ form = QFormLayout()
188+ self ._opt_onefile = add_form_checkbox(form, " Mode:" , " Onefile" , " opt_onefile_dynamic" )
189+ self ._opt_windowed = add_form_checkbox(form, " Console:" , " Windowed" , " opt_windowed_dynamic" )
190+
191+ self ._btn_select_icon = add_icon_selector(
192+ layout,
193+ " 🎨 Choose icon (.ico)" ,
194+ self .select_icon,
195+ " btn_select_icon_dynamic" ,
196+ )
197+
198+ self ._output_dir_input = add_output_dir(
199+ layout,
200+ " Output directory" ,
201+ " output_dir_input_dynamic" ,
202+ )
203+ ```
179204** I18n**
180205- Add ` languages/en.json ` , ` languages/fr.json ` , etc. in your engine package.
181206- Use ` resolve_language_code ` and ` load_engine_language_file ` (SDK) to load translations.
0 commit comments