LibUI

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


The initial slider value equals the minimum value.

In the current implementation upstream, `$min` and `$max` are swapped if `$min` is greater than `$max`. This may
change in the future though.

## ProgressBar Functions

A ProgressBar is a control that visualizes the progress of a task via the fill level of a horizontal bar.

Indeterminate values are supported via an animated bar.

### `uiProgressBarValue( ... )`

```perl
my $value = uiProgressBarValue( $bar );
```

Returns the progress bar value.

### `uiProgressBarSetValue( ... )`

```
uiProgressBarSetValue( $bar, 100 );
```

Sets the progress bar value.

Valid values are `[0 .. 100]` for displaying a solid bar imitating a percent value.

Use a value of `-1` to render an animated bar to convey an indeterminate value.

### `uiNewProgressBar( )`

Creates a new progress bar.

## Separator Functions

A separator is a control to visually separate controls, horizontally or vertically.

Import these functions with the `:separator` tag.

### `uiNewHorizontalSeparator( )`

```perl
my $hsplit = uiNewHorizontalSeparator( );
```

Creates a new horizontal separator.

### `uiNewVerticalSeparator( )`

```perl
my $hsplit = uiNewVerticalSeparator( );
```

Creates a new vertical separator.

## Combobox Functions

A combobox is a control to select one item from a predefined list of items via a drop down menu.

You may import these functions with the `:combobox` tag.

### `uiComboboxAppend( ... )`

```
uiComboboxAppend( $combo, 'Candy' );
```

Appends an item to the combo box.

### `uiComboboxInsertAt( ... )`

```
uiComboboxInsertAt( $combo, 4, 'Salty snacks' );
```

Inserts an item at `$index` to the combo box.

### `uiComboboxDelete( ... )`

```
uiComboboxDelete( $combo, 4 );
```

Deletes an item at `$index` from the combo box.

Deleting the index of the item currently selected will move the selection to the next item in the combo box or `-1` if
no such item exists.

### `uiComboboxClear( ... )`

```
uiComboboxClear( $combo );
```

Deletes all items from the combo box.

### `uiComboboxNumItems( ... )`

```perl
my $options = uiComboboxNumItems( $combo );
```

Returns the number of items contained within the combo box.

### `uiComboboxSelected( ... )`

```perl
my $current = uiComboboxSelected( $combo );
```

Returns the index of the item selected or `-1` on empty selection.

### `uiComboboxSetSelected( ... )`

```
uiComboboxSetSelected( $combo, 2 );
```

Sets the item selected. `-1` to clear selection.

### `uiComboboxOnSelected( ... )`

```perl
uiComboboxOnSelected( $combo, sub { my ($c, $user_data) = @_; }, undef );
```

Registers a callback for when a combo box item is selected.

The callback is not triggered when calling `uiComboboxSetSelected( ... )`, `uiComboboxInsertAt( ... )`,
`uiComboboxDelete( ... )`, or `uiComboboxClear( ... )`.

### `uiNewCombobox( )`

```perl
my $combo = uiNewCombobox( );
```

Creates a new combo box.

## Editable Combobox Functions

An editable combobox is a control to select one item from a predefined list of items or enter ones own.

Predefined items can be selected from a drop down menu.

A customary item can be entered by the user via an editable text field.

You may import these functions with the `:editablecombobox` tag.

### `uiEditableComboboxAppend( ... )`

```
uiEditableComboboxAppend( $combo, 'Fire' );
```

Appends an item to the editable combo box.

### `uiEditableComboboxText( ... )`

```perl
my $text = uiEditableComboboxText( $combo );
```

Returns the text of the editable combo box.

This text is either the text of one of the predefined list items or the text manually entered by the user.

### `uiEditableComboboxSetText( ... )`

```
uiEditableComboboxSetText( $combo, "Floating" );
```

Sets the editable combo box text.

### `uiEditableComboboxOnChanged( )`

```perl
uiEditableComboboxOnChanged( $combo, sub { my ($cb, user_data) = @_; }, undef );
```

Registers a callback for when an editable combo box item is selected or user text changed.

The callback is not triggered when calling `uiEditableComboboxSetText( ... )`.

### `uiNewEditableCombobox( )`

```perl
my $combo = uiNewEditableCombobox( );
```

Creates a new editable combo box.

## Menu Functions

Menus provide the standard menu functionality found at the top of application windows.

Each menu has a name and can contain items, check items, quit, preferences, about, and separators.

You may import these functions with the `:menu` tag.

### `uiNewMenu( ... )`

```perl
my $menu = uiNewMenu( 'File' );
```

Creates a new menu with the given name.



( run in 0.872 second using v1.01-cache-2.11-cpan-8dfa8b56332 )