src/swipl-devel/packages/xpce/man/refmanual/md/list_browser.md

class list_browser {#class-list_browser}

A list_browser object is a visualisation of a dict object. It appears as a scrollable list of (textual) items. The user may examine this list by scrolling and searching. S/he may select one or multiple items from the list (see <-multiple_selection).

List Browsers are commonly used for browsing or selection from a (possibly) large list of (named) objects. For example the manual's card viewer uses a browser to show existing see-also relation. The class-browser and various of the other manual tools use them to visualise sets of documentation cards.

List browsers are normally used through class browser which defines a window displaying a list_browser (like class view displays an editor object).

Various messages may be associated with list_browser objects:

| <->select_message        | Activated on left-click   |
| <->select_middle_message | Activated on middle-click |
| <->open_message          | Activated on double-click |

The <->open_message is also activated when an item is selected using the keyboard.

All these messages forward the following arguments:

| @receiver | The browser or list_browser object |
| @arg1     | The dict_item object selected.     |

It is possible to associate a popup with a list_browser. See ->popup. Finally, it is possible to program the event-handling yourself. The method <-dict_item may be used to translate events to dict_item objects.

Fonts and images {#class-list_browser-fonts-and-images}

XPCE browsers support multiple fonts and images indicating the type of the item. Each item can only be displayed in one font. Font and icon specification use the style object based mechanism to specify the appearance of a dict_item object of specified style. For example, to make a browser for files and directories, where the directories are printed purple and using the dir.bm icon, use the following code as a starting point:

...
new(B, browser),
send(B, style, directory,
     style(icon := 'dir.bm', colour := purple)),
send(B, style, file,
     style(icon := 'file.bm')),
...

append_directory(B, Name) :-
    send(B, append,
         dict_item(Name, style := directory)).

@see class key_binding @see class browser @see class dict

Class variables {#class-list_browser-classvars}

Instance variables {#class-list_browser-instvars}

Send methods {#class-list_browser-send}

Get methods {#class-list_browser-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.