The application programming interface (API) for user editing of cell values is similar to the interface provided by EwIconList. The main difference with a table list widget is that the beginEditCallback and endEditCallback resources are used to provide editing facilities for individual cell values rather than for items in the list. Cell editing can take place automatically as individual cells are selected, or it can occur under application control by using editing functions.
•
•
• The selectionPolicy resource of the table list must be set to XmCELLSINGLESELECT or XmCELLBLOCKSELECT.When cell editing is under application control, editing begins when the application sends editCellAt: or editSelectedCell to the table list widget. These functions can be used to trigger cell editing regardless of the value of the editable resource in the table or in its columns.In both automatic editing and application-controlled editing, an application must specify a callback handler for the beginEditCallback and endEditCallback resources for each column that is to provide editing capability. When a cell is about to be edited, either because you clicked in it or because the application sent editCellAt: or editSelectedCell, the column activates its beginEditCallback. The application must hook this callback for editing to occur. At a minimum, the application must set the callData doit flag to true to allow editing to begin.Editing ends when the widget loses focus or another item is selected. When this happens, or when the value in the edit widget has been changed (the exact details of when a change has occurred depend on the edit policy; see "Edit policies"), the column activates its endEditCallback. The callData includes the old value and the new value. Your application should hook this callback and save the new edited value in your application as appropriate. The cell is then automatically refreshed after the callback is sent, so that the new value is obtained and displayed.Next, the comment columns beginEditCallback and the endEditCallback must be hooked, and the editable resource must be set to true:
|