Next: , Up: Property Editor Widgets



7.6.1 Property Structure Definitions

Each property subtype has its own requirements on the editor. These requirements are stored in a data structure in the file gui/properties.c. The editor for a subtype is described by the following structure:

     struct pst_data
     {
         uns widget_type;
         char * description;
         union
         {
             struct { gdouble lower, upper, step, page; } spin;
             struct { uns max; string * strings; } combo;
             struct { uns dummy; } nothing;
             struct {
                 void (*create_edit_func)( struct prop_item * pi );
                 void (*update_edit_func)( struct prop_item * pi,
                                           struct prop * prop );
             } func;
         } data;
     };

The widget type can be one of these:

The description is used when creating a new property and specifying its subtype. Then only some property subtypes are shown (we believe that, for example, the PTU_CAP_STYLE subtype for line caps is not very useful for user-defined properties) and those are subtypes with non-NULL description. The description is shown in the subtype list.