IupListDialog

IUP - Portable User Interface

IupListDialog

Shows a modal dialog to select options from a simple or multiple list.

Creation and Show

int IupListDialog(int type, char *title, int size, char *list[], int option, int max_col, int max_lin, int mark[]); [in C]
IupListDialog(type: number, title: string, size: number, list: table of strings, option: number, max_col: number, max_lin: number, mark: table of numbers) -> see comments [in IupLua3]
iup.ListDialog(type: number, title: string, size: number, list: table of strings, option: number, max_col: number, max_lin: number, mark: table of numbers) -> see comments [in IupLua5]

type: =1 simple selection; =2 multiple selection
title: Text for the dialog’s title
size: Number of options
list: List of options
option: Initial option, starting at 1 (note that this index is different from the return value, kept for compability reasons)
max_col: Maximum number of columns in the list
max_lin: Maximum number of lines in the list
mark: Flag vector, used only when type=2

When type=1, the function returns the number of the selected option (the first option is 0), or -1 if the user cancels the operation.

When type=2, the function returns -1 when the user cancels the operation. If the user does not cancel the operationthe function returns a non zero value and the mark parameter will have value 1 for the options selected by the user and value 0 for non-selected options.

Comments

In IupLua, the return value depends on used option. In case type is 1 (simple selection), the return value is a 0-based number of the selected option. If the type is 2 (multiple selection), the return type is a table with the marked options.

The dialog uses a global attribute called "PARENTDIALOG" as the parent dialog if it is defined. It also uses a global attribute called "ICON" as the dialog icon if it is defined.

Examples

See Also

IupMessage, IupScanf, IupGetFile, IupAlarm