~ubuntu-branches/debian/sid/ncurses/sid-200908151531

« back to all changes in this revision

Viewing changes to test/demo_forms.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-11-05 21:34:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20081105213400-7d9r3jj2ngz18k24
Tags: 5.7-1
* Merging upstream version 5.7.
* Updating soname and sodepver to 5.7 in rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * authorization.                                                           *
27
27
 ****************************************************************************/
28
28
/*
29
 
 * $Id: demo_forms.c,v 1.31 2008/12/20 19:23:00 tom Exp $
 
29
 * $Id: demo_forms.c,v 1.30 2008/10/18 20:38:20 tom Exp $
30
30
 *
31
31
 * Demonstrate a variety of functions from the form library.
32
32
 * Thomas Dickey - 2003/4/26
97
97
    FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1);
98
98
 
99
99
    if (f) {
100
 
        FieldAttrs *ptr;
101
 
 
102
100
        set_field_back(f, A_UNDERLINE);
103
101
        /*
104
102
         * If -j and -d options are combined, -j loses.  It is documented in
124
122
        /*
125
123
         * The userptr is used in edit_field.c's inactive_field().
126
124
         */
127
 
        ptr = (FieldAttrs *) field_userptr(f);
128
 
        if (ptr == 0) {
129
 
            ptr = typeCalloc(FieldAttrs, 1);
130
 
            ptr->background = field_back(f);
131
 
        }
132
 
        set_field_userptr(f, (void *) ptr);
 
125
        set_field_userptr(f, (void *) (long) field_back(f));
133
126
        if (t_value)
134
127
            set_field_buffer(f, 0, t_value);
135
128
    }