Exploring Tk::MListbox - A Tutorial

Exploring Tk::MListbox - A Tutorial | Document Info
Class Reference | FAQ | Changes/Bug fixes |
Date: | 20 Dec 2001
Author: | Rob Seegel
Package:
| MListbox

- What is it and what is it good for?

- Features

- Common tasks

- Adding
- Selecting
- Removing

- Additional Functionality

- Binding Methods

- Related Documents

## What is it and what is it good for?

MListbox is a composite widget that's all about making potentially complicated tasks easier. It provides an easy way to implement tabular displays such as what might be needed to display the result set from a database query, or a list of files and directories. As it turns out, displaying data in columns is a common task, and there are other Tk widgets that provide similar functionality, and so much the better - choice is good. The different implementations each have their own strengths, and while there is a lot of overlap, some have features that the others don't. So what does MListbox offer?

## Using ML

MListbox...

- Is coded in perl - no worries about compiling and customization is bit easier
- Handles sorting, by pressing on column headers or by using the API. Further, it handles multi-column sorting by one or more keys. You can even create your customized sorting routines for a column.
- Handles manual column resizing
- Handles moveable columns. Users can reorder columns manually using drag and drop
- Provides the means to efficiently show or hide individual columns
- Offers a simple API - A majority of the methods should be familiar to Listbox users

Currently, MListbox does have a few limitations - most of these limitations are directly because of Listbox. MListbox does not and cannot support several individually color rows - columns, yes, but not rows. The same holds true for fonts. Also, other widgets cannot be embedded into rows. Text justification is to the left only, and a single cells content can only be displayed in a single line without wrapping. All these things, and more can be handled using Tk::HList should you require them. Unfortunately, these other features come at the cost of built-in sorting, resizing, moveable columns and a slightly more complex API.

## Features