updates from rob browning

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@893 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-06-15 05:36:37 +00:00
parent 167058962d
commit d63896c7a6
2 changed files with 25 additions and 13 deletions

View File

@ -97,12 +97,18 @@ void xaccInitComboCell (ComboCell *cell)
static
void destroyCombo (BasicCell *bcell)
{
ComboCell *cell;
ComboCell *cell = (ComboCell *) bcell;
PopBox *box = (PopBox *) (cell->cell.gui_private);
cell = (ComboCell *) bcell;
if (!(cell->cell.realize)) {
PopBox *box = (PopBox *) (cell->cell.gui_private);
/* HACK: I had to put the three extra tests in the guard so that
we don't get a segfault on register window closes. I haven't checked
to be sure this is exactly the right thing to do, but it works.
Actually, almost all of the combobox (and table-gtk for that
matter) code is an ugly hack that should go away when we have a
real table widget... */
if (!(cell->cell.realize) && box && box->table && box->table->entry_frame) {
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
GTK_WIDGET(box->combobox));
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),

View File

@ -614,6 +614,8 @@ xaccCreateTable (Table *table, GtkWidget * parent)
}
gtk_clist_thaw(GTK_CLIST(reg));
}
gtk_clist_set_policy(GTK_CLIST(reg),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_clist_freeze(GTK_CLIST(reg));
for(i = num_header_rows; i < table->num_phys_rows; i++) {
@ -712,7 +714,7 @@ void
xaccRefreshTableGUI (Table * table)
{
CellBlock *curs;
GtkWidget * reg;
GtkCList * reg;
int num_header_rows = 0;
int i, j;
@ -722,7 +724,7 @@ xaccRefreshTableGUI (Table * table)
/* The 0'th row of the handlers is defined as the header */
curs = table->handlers[0][0];
num_header_rows = curs->numRows;
reg = table->table_widget;
reg = GTK_CLIST(table->table_widget);
printf (" refresh numphysrows=%d numphyscols=%d \n",
table->num_phys_rows, table->num_phys_cols);
@ -733,20 +735,24 @@ xaccRefreshTableGUI (Table * table)
table->entries[i][3]);
}
gtk_clist_freeze(GTK_CLIST(reg));
gtk_clist_freeze(reg);
while(GTK_CLIST(reg)->rows < (table->num_phys_rows - num_header_rows)) {
gtk_clist_append(GTK_CLIST(reg), NULL);
/* Adjust table to have the right number of rows */
while(reg->rows < (table->num_phys_rows - num_header_rows)) {
gtk_clist_append(reg, NULL);
}
while(reg->rows > (table->num_phys_rows - num_header_rows)) {
gtk_clist_remove(reg, 0);
}
for(i = num_header_rows; i < table->num_phys_rows; i++)
{
for(j = 0; j < table->num_phys_cols; j++) {
gtk_clist_set_text(GTK_CLIST(reg), i - num_header_rows, j,
table->entries[i][j]);
gtk_clist_set_text(reg, i - num_header_rows, j, table->entries[i][j]);
}
}
gtk_clist_thaw(GTK_CLIST(reg));
gtk_clist_thaw(reg);
}
/* ================== end of file ======================= */