list_model.h File Reference

List_Model Abstract Widget. More...

#include "ntw.h"

Go to the source code of this file.

Data Structures

struct  ntw_list_model_node
struct  ntw_list_model

Functions

int ntw_list_model_data_send (struct ntw_list_model *lm, FILE *file)
int ntw_list_model_get_column_type (ntwWidget *widget, int32 column)
 Get the type of a particular column in a list model.
int ntw_list_model_clear (ntwWidget *widget)
 Delete all rows from list_model.
int32 ntw_list_model_delete_row (ntwWidget *widget, int row)
 Delete a single row from list_model.
int32 ntw_list_model_insert_row (ntwWidget *widget, int row,...)
 Add row to list_model.
ntwWidget * ntw_list_model_new (int32 columns,...)
 Create a list model.
void ntw_list_model_initialize_callback ()


Detailed Description

List_Model Abstract Widget.

A list_model is an abstract widget that's used with various viewer widgets that display the list_model's data. The list_model data is stored in rows that have a specified number of columns. Each column contains the same type of data. The list_model stores flat data, so there is no hierarchical structure as would exist in a tree.


Function Documentation

int ntw_list_model_clear ntwWidget *  widget  ) 
 

Delete all rows from list_model.

Parameters:
widget list_model to clear
Returns:
-1 on failure

int32 ntw_list_model_delete_row ntwWidget *  widget,
int  row
 

Delete a single row from list_model.

Parameters:
widget list_model to delete row from
row number of row to delete
Returns:
Location of row deleted. -1 on failure

int ntw_list_model_get_column_type ntwWidget *  widget,
int32  column
 

Get the type of a particular column in a list model.

Parameters:
widget list_model widget
column number of column
Returns:
column_type

int32 ntw_list_model_insert_row ntwWidget *  widget,
int  row,
  ...
 

Add row to list_model.

Example
ntw_list_model_insert_row(my_list_model, 1, 0, "Data for first column", 1, "Data for second column", -1);

Parameters:
widget list_model to add row to
row where to insert the row. Numbers larger than the largest row will append to end of list, while numbers < 0 will prepend to the beginning.
... -1 terminated list of data to be inserted. Format is column_number, data.
Returns:
Number of actual row inserted.

ntwWidget* ntw_list_model_new int32  columns,
  ...
 

Create a list model.

Parameters:
columns number of columns each row will contain
... Data type for each column. May be any of:
  • DT_BOOLEAN - Boolean data
  • DT_INT - 32 bit signed integer
  • DT_UINT - 32 bit unsigned integer
  • DT_FLOAT - Floating point number (double)
  • DT_IMAGE - Image buffer
  • DT_STRING - UTF-8 text string
Returns:
Newly created list_model


Generated on Wed Jun 28 17:00:07 2006 for NTW Server C Library by  doxygen 1.4.6