![]() |
Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
|
MVP-oriented Tkinter code generator for SBL GUI JSON specs.
This module defines :class:`GeneratorTkinter`, which renders a parsed GUI
object (see ``gui_json_schema.GUI``) into a prepared VMD plugin project template.
Highlights:
- Absolute positioning is honored when widgets provide ``x``, ``y``, ``width``,
and ``height``; otherwise, widgets are placed within a scrollable input panel.
- Specialized emitters for common output widgets:
- TextArea (``tk.Text``)
- ImageView (``ttk.Label`` placeholder; uses PIL if available)
- TableView (``ttk.Treeview``)
- Frame (scrollable Canvas + inner Frame)
- HtmlView (``tkinterweb.HtmlFrame`` if installed)
- Unique variable names via ``gui_codegen.CodeGenerator.generate_unique_id``.
- Output widget registration to enable later refresh/update of results.
- Window resize handler that scales absolute-positioned widgets proportionally.
Primary API:
- ``GeneratorTkinter.generate_codes(gui, exe_name, post_script) -> dict[str, str]``
Returns a dictionary mapping file names to their generated source code.