Refreshing a cursor?

Derek Atkins warlord@MIT.EDU
29 Nov 2001 12:13:01 -0500


So, I tried this.  In the traverse() callback in
split-register-control.c I have a block of code that reads:

  do
  {
    BasicCell *cell;
    const char *ddue;

    if (!gnc_cell_name_equal (cell_name, TYPE_CELL))
      break;

    cell = gnc_table_layout_get_cell (reg->table->layout, DDUE_CELL);
    if (!cell)
      break;

    if (gnc_table_layout_get_cell_changed (reg->table->layout,
					   TYPE_CELL, FALSE)) {
      const char *ddue_str;

      PWARN ("type cell changed: refresh cursor");

      ddue_str = gnc_split_register_get_due_date_string (reg, virt_loc);
      gnc_basic_cell_set_value (cell, ddue_str);

      /* Note: How to set the editability? */
    }

  } while (FALSE);

Unfortunately it STILL doesn't clear out the value of the DDUE_CELL.
My PWARN()s are telling me that it should be doing that.  Also, I
haven't figured out how to reset the editability of a cell in the
current cursor, either.

Suggestions?

-derek


> Dave Peticolas <dave@krondo.com> writes:
> 
> > Ah, I left out an important detail: for editable fields,
> > the contents of the current cursor are controlled by the
> > cells, not by the entry callbacks. So if you want to
> > change the contents of an editable column in the
> > current cursor, you need to change the cell itself.
> > 
> > That should work without adding the extra call.
> > 
> > dave
> 
> Ahh, so this implies that I need to reset the DDUE_CELL directly from
> the traverse() callback, right?  How do I change the editability of a
> 'column' within the current cursor?
> 
> -derek
> 
> -- 
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warlord@MIT.EDU                        PGP key available
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnumatic.com
> http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available