Re: [AD] Filtered d_edit_proc() patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> The attached patch modifies d_edit_proc() so that you
> can create fields that only accept numbers, capital
> letters, etc. To do so, just write a filter callback
> and set a pointer to it in the edit proc's dp2 field.

Nice! I like this, and I don' think it would break existing code (existing
addons may be a different story though). What do others think about this?
Otherwise, d_edit_proc_ex() anyone? ;)

About the patch, it looks ok except that you should take care not to call
the callback if it is NULL, as it would be for older code.

> The function is of the form:
>    int edit_callback(int c, void *dp3);

Any reason you're passing it dp3 and not, say, dp1?

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/