Module view.Utils

Interface creation utilities.

Functions

Utils.new_button (stock, label) Creates a stock button with a custom label.
Utils.new_frame (label) Creates a new frame with a label.
Utils.new_tool_button (stock, label) Creates a stock tool button.
Utils.new_tool_item (label, entry) Creates a label | main widget ToolItem.
Utils.populate_model (model, values, clear, view) Populates a model using values from a table.
Utils.show_confirmation (message) Shows a confirmation dialog (Cancel, OK buttons).
Utils.show_info (message) Shows a info dialog (OK button).


Functions

Utils.new_button (stock, label)
Creates a stock button with a custom label.

Parameters

  • stock: Stock id
  • label: Label to override the stock one

Return value:

New Button
Utils.new_frame (label)
Creates a new frame with a label.

Parameters

  • label: Frame label

Return value:

New frame
Utils.new_tool_button (stock, label)
Creates a stock tool button. Makes GTK+ respect the use-underline property!

Parameters

  • stock: Stock id
  • label: Label to override the stock one

Return value:

New ToolButton
Utils.new_tool_item (label, entry)
Creates a label | main widget ToolItem.

Parameters

  • label: Label widget
  • entry: Widget to serve as content

Return value:

New composed tool item
Utils.populate_model (model, values, clear, view)
Populates a model using values from a table. Does not accept nils.

Parameters

  • model: Model to be populated
  • values: Values in the form { {cell11, cell12}, {cell21, cell22}, ... }
  • clear: true to also clear the model before the population
  • view: View of the model to freeze signals (optional)
Utils.show_confirmation (message)
Shows a confirmation dialog (Cancel, OK buttons).

Parameters

  • message: Message to show on the dialog

Return value:

true if the user clicked OK, false otherwise
Utils.show_info (message)
Shows a info dialog (OK button).

Parameters

  • message: Message to show on the dialog

Valid XHTML 1.0!