turns out cursor initialization needs to go into its own routine

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@921 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-07-27 06:04:55 +00:00
parent 00b6759198
commit 92a7cc9698
2 changed files with 32 additions and 25 deletions

View File

@ -208,8 +208,8 @@ enterCB (Widget mw, XtPointer cd, XtPointer cb)
rel_row = table->locators[row][col]->phys_row_offset;
rel_col = table->locators[row][col]->phys_col_offset;
printf ("enter %d %d (rel=%d %d %p) %p\n", row, col, rel_row, rel_col,
arr->cells[rel_row][rel_col], arr );
printf ("enter %d %d (relrow=%d relcol=%d) cell=%p\n", row, col, rel_row, rel_col,
arr->cells[rel_row][rel_col]);
/* since we are here, there must be a cell handler.
* therefore, we accept entry into the cell by default,
@ -544,37 +544,43 @@ xaccCreateTable (Table *table, Widget parent, char * name)
table->table_widget = reg;
/* if any of the cells have GUI specific components that need
* initialization, initialize them now. The realize() callback
* on the cursor cell is how we inform the cell handler that
* now is the time to initialize it's GUI. */
return (reg);
}
curs = table->current_cursor;
if (curs) {
int i,j;
/* ==================================================== */
/* if any of the cells have GUI specific components that need
* initialization, initialize them now. The realize() callback
* on the cursor cell is how we inform the cell handler that
* now is the time to initialize it's GUI. */
for (i=0; i<curs->numRows; i++) {
for (j=0; j<curs->numCols; j++) {
BasicCell *cell;
cell = curs->cells[i][j];
if (cell) {
void (*xt_realize) (BasicCell *,
void *gui,
int pixel_width);
xt_realize = cell->realize;
if (xt_realize) {
int pixel_width;
pixel_width = XbaeMatrixGetColumnPixelWidth (reg, j);
xt_realize (cell, ((void *) reg), pixel_width);
}
void
xaccCreateCursor (Table *table, CellBlock *curs)
{
int i,j;
Widget reg = table->table_widget;
if (!curs) return;
for (i=0; i<curs->numRows; i++) {
for (j=0; j<curs->numCols; j++) {
BasicCell *cell;
cell = curs->cells[i][j];
if (cell) {
void (*xt_realize) (BasicCell *,
void *gui,
int pixel_width);
xt_realize = cell->realize;
if (xt_realize) {
int pixel_width;
pixel_width = XbaeMatrixGetColumnPixelWidth (reg, j);
xt_realize (cell, ((void *) reg), pixel_width);
}
}
}
}
return (reg);
}
/* ==================================================== */
#define NOOP(x) /* do nothing */

View File

@ -78,6 +78,7 @@ typedef struct _Table Table;
/* create the widget */
Widget xaccCreateTable (Table *, Widget parent, char * name);
void xaccCreateCursor (Table *, CellBlock *);
void xaccNextTabGroup (Table *, Widget);
void xaccMotifResizeTable (Table * table,