Joanna Lee wrote:
> I would like to be able to perform a certain action (i.e. updating cell
> contents) as soon as the matrix is scrolled. I want to update only those
> cells that are visible so, as soon as the matrix is scrolled, the visible
> cells change and therefore I would need to update the new visible cells'
> contents.
>
> Is there a way to get this info? Would I get this information from editing
> ScrollMgr.c?
The manual page mentions XmNdrawCellCallback and XmNwriteCellCallback, see
below.
They probably solve your problem.
Danny
XmNdrawCellCallback
Specifies a list of callbacks to be called when a cell needs to be drawn. A
pointer to an
XbaeMatrixDrawCellCallbackStruct is passed to the callbacks. The application
can specify
what to put in a cell by modifying the callback struct's data fields. When the
application
callback returns to the widget code, the type field will determine what the
widget draws on
the screen. If the value is XbaeString, then the regular string drawing
function for the
widget will be called with the value the applicaton assigned to the string
field in the struct.
Else, if the value is XbaePixmap, the widget will do an XCopyPlane(), in the
case of a single
plane bitmap, or XCopyArea(), in the case of a color pixmap. The width and
height of cell is
passed in the struct so the application can know how big to make the pixmap. In
neither case
will a copy of the string or the pixmap value be made. The widget also uses the
XmNcolumnAlignments resource to determine the horizontal alignment of the
Pixmap. To have an
editable array of data when the XmNdrawCellCallback is used and the cell is of
type XbaeString,
use the XmNwriteCellCallback.
XmNwriteCellCallback
Specifies a list of callbacks to be called when a cell value changes and an
XmNdrawCellCallback
is defined. A pointer to an XbaeMatrixWriteCellCallbackStruct is passed to the
callbacks. The
XmNwriteCellCallback allows data to be written back into the application's data
structure and
must be defined for an editable XbaeMatrix with an XmNdrawCellCallback.
--
Danny Backx ([EMAIL PROTECTED] [EMAIL PROTECTED])
Home page : http://users.skynet.be/danny.backx
Projects: LessTif (http://www.lesstif.org)
Oleo (http://www.gnu.org/software/oleo/oleo.html)