diff --git a/src/register/combocell.c b/src/register/combocell.c index 9ca8a495da..37a1904ab3 100644 --- a/src/register/combocell.c +++ b/src/register/combocell.c @@ -99,10 +99,13 @@ void destroyCombo (BasicCell *bcell) box = (PopBox *) (cell->cell.gui_private); - moveCombo (bcell, -1, -1); - - XtDestroyWidget (box->combobox); - free (box); + if (box) { + if (XtIsRealized(box->combobox)) { + moveCombo (bcell, -1, -1); + XtDestroyWidget (box->combobox); + } + free (box); + } /* allow the widget to be created again */ cell->cell.gui_private = NULL; diff --git a/src/register/register.c b/src/register/register.c index 04441df773..7854c9e18d 100644 --- a/src/register/register.c +++ b/src/register/register.c @@ -307,6 +307,7 @@ void xaccInitBasicRegister (BasicRegister *reg, int type) { Table * table; CellBlock *curs, *header; + int phys_r, phys_c; reg->user_hook = NULL; reg->destroy = NULL; @@ -374,8 +375,13 @@ void xaccInitBasicRegister (BasicRegister *reg, int type) /* -------------------------------- */ table = xaccMallocTable (); - xaccSetTableSize (table, header->numRows, header->numCols, 1, 1); + phys_r = header->numRows + curs->numRows; + phys_c = header->numCols; + xaccSetTableSize (table, phys_r, phys_c, 2, 1); xaccSetCursor (table, header, 0, 0, 0, 0); + xaccSetCursor (table, curs, header->numRows, 0, 1, 0); + xaccMoveCursor (table, header->numRows, 0); + reg->table = table; } diff --git a/src/register/table-motif.c b/src/register/table-motif.c index 5ee53de0fb..975b46ec06 100644 --- a/src/register/table-motif.c +++ b/src/register/table-motif.c @@ -555,13 +555,10 @@ xaccCreateTable (Table *table, Widget parent, char * name) haveQuarks = True; } - /* if a header exists, get alignments, widths from there */ + /* The 0'th row of the handlers is defeined as the header */ alignments = NULL; widths = NULL; - curs = table->current_cursor; - if (!curs) { - curs = table->handlers[0][0]; - } + curs = table->handlers[0][0]; alignments = curs->alignments; widths = curs->widths; num_header_rows = curs->numRows;