While embedding is cool, you should be careful not to overdo it. Too many functions inside a GUI just make it hard to find the relevant options. Of course, sometimes you may want to embed a great deal of options (like all the options to plot()
), but as those are really optional, you do not want them prominently in your GUI.
An alternative is to embed those options “as a button”:
<dialog> <tabbook> [...] <tab label="Options"> [...] <embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Specify plotting options"/> </tab> [...] </tabbook> </dialog>
In this case, a single push button will be added to your plugin, labeled . When you press that button, a separate dialog will come up, with all the options of the embedded plugin. Even while this embedded GUI is not visible most of the time, you can fetch its settings just as described above.
Caution
Probably the “button” approach should only ever be used for plugins that can never be invalid (for missing/bad settings). Otherwise the user would not be able to submit the code, but might have a hard time finding out, the reason for that is hidden behind some button.