From a431a46da7eefba0c9bc45842a4cd63769eab900 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 15 Sep 2003 04:43:47 +0000 Subject: updated #ifdef code to make savefn and propertiesfn work under 0.37 svn path=/trunk/externals/unauthorized/; revision=965 --- grid/grid.c | 13 +++++++++---- grid/grid2.c | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'grid') diff --git a/grid/grid.c b/grid/grid.c index 5042f4e..2f61374 100644 --- a/grid/grid.c +++ b/grid/grid.c @@ -669,13 +669,18 @@ void grid_setup(void) grid_widgetbehavior.w_deletefn = grid_delete; grid_widgetbehavior.w_visfn = grid_vis; grid_widgetbehavior.w_clickfn = grid_click; - /* As of 0.37, the last two elements of t_widgetbehavoir */ - /* have been removed. */ -#if PD_MAJOR_VERSION == 0 + /* + * : As of 0.37, pd does not have these last + * two elements in t_widgetbehavoir anymore. + * see pd/src/notes.txt: + * savefunction and dialog into class structure + */ #if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) grid_widgetbehavior.w_propertiesfn = grid_properties; grid_widgetbehavior.w_savefn = grid_save; -#endif +#else + class_setsavefn(grid_class, &grid_save); + class_setpropertiesfn(grid_class, &grid_properties); #endif class_setwidget(grid_class, &grid_widgetbehavior); class_sethelpsymbol(grid_class, gensym("help-grid.pd")); diff --git a/grid/grid2.c b/grid/grid2.c index 426e2d2..070aa04 100644 --- a/grid/grid2.c +++ b/grid/grid2.c @@ -535,13 +535,18 @@ void grid_setup(void) grid_widgetbehavior.w_deletefn = grid_delete; grid_widgetbehavior.w_visfn = grid_vis; grid_widgetbehavior.w_clickfn = grid_click; - /* As of 0.37, the last two elements of t_widgetbehavoir */ - /* have been removed. */ -#if PD_MAJOR_VERSION == 0 + /* + * : As of 0.37, pd does not have these last + * two elements in t_widgetbehavoir anymore. + * see pd/src/notes.txt: + * savefunction and dialog into class structure + */ #if PD_MINOR_VERSION < 37 || !defined(PD_MINOR_VERSION) grid_widgetbehavior.w_propertiesfn = grid_properties; grid_widgetbehavior.w_savefn = grid_save; -#endif +#else + class_setsavefn(grid_class, &grid_save); + class_setpropertiesfn(grid_class, &grid_properties); #endif class_setwidget(grid_class, &grid_widgetbehavior); class_sethelpsymbol(grid_class, gensym("help-grid.pd")); -- cgit v1.2.1