| |
- gtk.Button(gtk.Bin)
-
- ColourButton
- FontButton
- gtk.Dialog(gtk.Window)
-
- OptionsBox
class OptionsBox(gtk.Dialog) |
|
A dialog box which lets the user edit the options. The file
Options.xml specifies the layout of this box. |
|
Methods defined here:
- __init__(self, options_group, options_xml, translation=None)
- options_xml is an XML file, usually <app_dir>/Options.xml,
which defines the layout of the OptionsBox.
It contains an <options> root element containing (nested)
<section> elements. Each <section> contains a number of widgets,
some of which correspond to options. The build_* functions are
used to create them.
Example:
<?xml version='1.0'?>
<options>
<section title='First section'>
<label>Here are some options</label>
<entry name='default_name' label='Default file name'>
When saving an untitled file, use this name as the default.
</entry>
<section title='Nested section'>
...
</section>
</section>
</options>
- build_colour(self, node, label, option)
- <colour name='...' label='...'>Tooltip</colour>
- build_entry(self, node, label, option)
- <entry name='...' label='...'>Tooltip</entry>
- build_font(self, node, label, option)
- <font name='...' label='...'>Tooltip</font>
- build_frame(self, node, label)
- <frame label='Title'>...</frame> to group options under a heading.
- build_hbox(self, node, label)
- <hbox>...</hbox> to layout child widgets horizontally.
- build_label(self, node, label)
- build_menu(self, node, label, option)
- Build an OptionMenu widget, only one item of which may be selected.
<menu name='...' label='...'>
<item value='...' label='...'/>
<item value='...' label='...'/>
</menu>
- build_numentry(self, node, label, option)
- <numentry name='...' label='...' min='0' max='100' step='1'>Tooltip</numentry>.
Lets the user choose a number from min to max.
- build_radio_group(self, node, label, option)
- Build a list of radio buttons, only one of which may be selected.
<radio-group name='...'>
<radio value='...' label='...'>Tooltip</radio>
<radio value='...' label='...'>Tooltip</radio>
</radio-group>
- build_secretentry(self, node, label, option)
- <secretentry name='...' label='...' char='*'>Tooltip</secretentry>
- build_section(self, section, parent)
- Create a new page for the notebook and a new entry in the
sections tree, and build all the widgets inside the page.
- build_spacer(self, node, label)
- <spacer/>
- build_toggle(self, node, label, option)
- <toggle name='...' label='...'>Tooltip</toggle>
- build_vbox(self, node, label)
- <vbox>...</vbox> to layout child widgets vertically.
- build_widget(self, node, box)
- Dispatches the job of dealing with a DOM Node to the
appropriate build_* function.
- build_window_frame(self)
- Create the main structure of the window.
- changed(self)
- Check whether any options have different values (ie, whether Revert
will do anything).
- check_widget(self, option)
- A widgets call this when the user changes its value.
- do_box(self, node, label, widget)
- Helper function for building hbox, vbox and frame widgets.
- do_entry(self, node, label, option)
- Helper function for entry and secretentry widgets
- may_add_tip(self, widget, node)
- If 'node' contains any text, use that as the tip for 'widget'.
- open(self)
- Show the window, updating all the widgets at the same
time. Use this instead of show().
- update_revert(self)
- Shade/unshade the Revert button. Internal.
- update_widgets(self)
- Make widgets show current values. Internal.
| |