Devel::MAT::UI(3pm) | User Contributed Perl Documentation | Devel::MAT::UI(3pm) |
"Devel::MAT::UI" - extend the user interface of a "Devel::MAT" explorer
This virtual package provides methods that Devel::MAT::Tool classes can use to extend the user interface provided by a Devel::MAT explorer program. This package does not exist in a real .pm file; instead, the methods should be provided directly by the explorer program. A tool class can rely on being able to call them without doing anything special - do not attempt to "use Devel::MAT::UI".
Devel::MAT::UI->register_icon( name => $name, ... )
A tool may call this to register a named icon image with the UI, for later use in an SV list column or SV detail. The name of the icon is taken from the "name" key, and the specific UI implementation will use one of the other keys to provide the value for its type.
This icon is used by SV list columns or SV details where the "type" is "icon". The value set gives the name the icon was registered with.
Devel::MAT::UI->provides_radiobutton_set( @buttons )
A tool may call this to declare that it wishes to have a set of radiobuttons as a choice of options to be displayed in the toolbar of the user interface. Each button is specified in a HASH reference in the @buttons list containing the following keys:
The buttons will be displayed in a group of their own, such that selecting one will deactivate all the others in the same set.
$column = Devel::MAT::UI->provides_svlist_column( type => ..., title => ... )
A tool may call this to declare that it wishes to provide a new column to display in the main SV list on the user interface. It returns an opaque column value that should be passed to "set_svlist_column_values" to provide data for the column.
Opaque column values to represent the predefined SV list columns.
Devel::MAT::UI->set_svlist_column_values( column => $column, from => $from )
A tool may call this to provide the values to display in the SV list column it earlier created by calling "provides_svlist_column", or to replace the values in any of the predefined columns.
$value = $from->( $sv )
Devel::MAT::UI->provides_sv_detail( type => $type, title => $title, render => $render )
A tool may call this to declare that it provides a section of detail about an SV.
$value = $render->( $sv )
If the type is "widget", any of the following "make_*" methods can be used by the render function to generate a widget to display.
$widget = Devel::MAT::UI->make_widget_text( $text )
Constructs a widget displaying a fixed text string.
$widget = Devel::MAT::UI->make_widget_text_icon( $text, $icon )
Constructs a widget displaying a fixed text string next to an icon.
$widget = Devel::MAT::UI->make_table( $label => $widget, $label => $widget, ... )
Constructs a widget displaying a labeled table of other widgets.
$sv = Devel::MAT::UI->current_sv
If the UI has a concept of the "current" SV that the user is viewing, this method returns it. This may be used by tools to pick a default SV on which to operate, in case one was not supplied on the commandline.
Paul Evans <leonerd@leonerd.org.uk>
2023-03-26 | perl v5.36.0 |