[Top] [Prev] [Next] [Bottom] [Contents]

SaMakeCbsByCol

Makes an SaCallbackStruct for one column of an SaCallbackStruct callback structure.

Synopsis

#include "SaPopCalls.h"
SaCallbackStruct* SaMakeCbsByCol(SaCallbackStruct *cbs, 
						int col);

Arguments

cbs
SaCallbackStruct callback structure.
col
Specifies which column to use in order to make the return SaCallbackStruct.

Return Values

A SaCallbackStruct containing the data from one column of an SaCallbackStruct. A NULL pointer is returned if cbs is NULL or if the column specification is invalid.

Description

SaMakeCbsByCol returns a malloc'd SaCallbackStruct given a callback structure. The col parameter specifies which column from the first group in cbs is used to make the return SaCallbackStruct. If cbs is NULL or an invalid column specification is used, a NULL pointer is returned. Use SaFreeCbs() to deallocate this memory when it is no longer needed. The returned structure should be considered read-only data. Also, the actual data values in the structure should only be used while the underlying data is valid. This is usually after the Population callback function returns, although it may extend beyond that if the data is cached and not overwritten.

Example

#include "SaConsoleCalls.h"
void SaPopulateFields(list, client_data, cbs)
Widget list;
XtPointer client_data;
SaCallbackStruct *cbs;
{
	SaCallbackStruct *pcbs;
	pcbs = SaMakeCbsStartStopCol(cbs, 0, 5);
	SaPopulateTextFieldByCol(UxGetWidget(textField3),0,pcbs);
	SaPopulateTextFieldByCol(UxGetWidget(textField4),1,pcbs);
	SaPopulateTextFieldByCol(UxGetWidget(textField6),2,pcbs);
	SaPopulateTextFieldByCol(UxGetWidget(textField5),3,pcbs);
	SaPopulateTextFieldByCol(UxGetWidget(textField8),4,pcbs);
	SaPopulateTextFieldByCol(UxGetWidget(textField7),5,pcbs);
	SaFreeCbs(pcbs);
	pcbs = SaMakeCbsByCol(cbs, 2);
	SaPopulateTitleAndIcon(UxGetWidget(topLevelShell1), 
		NULL,pcbs);
	SaFreeCbs(pcbs);
	pcbs = SaMakeCbsByGroup(cbs, 0);
	SaPopulateList(UxGetWidget(scrolledList1), NULL, pcbs);
	SaFreeCbs(pcbs);
	pcbs = SaMakeCbsStartColRange(cbs, 6, 1);
	SaPopulateTextField(UxGetWidget(textField7), NULL,pcbs);
	SaFreeCbs(pcbs);
}

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.