Method: Ruber::SettingsContainer#add_widget

Defined in:
lib/ruber/settings_container.rb

#add_widget(w) ⇒ nil

Instructs the container to add a widget to the associated dialog

The widget won’t be immediately added to the dialog. This method only gives the container information about the widget to insert in the dialog. The widget itself will only be created and inserted in the dialog when it will first be shown.

This method resets the dialog.

below

Parameters:

  • w (Object)

    the object describing the widget. It must have the methods documented

Options Hash (w):

  • caption (String)

    the name of the page the widget should be put into. If the page doesn’t exist in the dialog, it will be added. Otherwise, the widget will be added to the one already existing in the page

  • class_obj (Class) — default: nil

    the class of the widget to create. The class’s @initialize@ method must take no parameters. Either this method or the @code@ method must not be nil

  • code (String) — default: nil

    a piece of ruby code which, when executed in the @TOPLEVEL_BINDING@, will return the widget to add to the dialog. Either this method or the @class_obje@ method must not be nil. If both are not nil, this method will have the precedence

  • pixmap (String) — default: ''

    the path of the pixmap to associate to the page

Returns:

  • (nil)

See Also:



383
384
385
386
387
# File 'lib/ruber/settings_container.rb', line 383

def add_widget w
  @widgets << w
  delete_dialog
  nil
end