Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.33 diff -c -p -r1.33 graphics.h.in *** src/graphics.h.in 14 Jan 2008 08:58:02 -0000 1.33 --- src/graphics.h.in 14 Jan 2008 10:57:51 -0000 *************** public: *** 2532,2541 **** static graphics_handle make_graphics_handle (const std::string& go_name, ! const graphics_handle& parent) { return instance_ok () ! ? instance->do_make_graphics_handle (go_name, parent) : graphics_handle (); } --- 2532,2541 ---- static graphics_handle make_graphics_handle (const std::string& go_name, ! const graphics_handle& parent, bool do_createfcn = true) { return instance_ok () ! ? instance->do_make_graphics_handle (go_name, parent, do_createfcn) : graphics_handle (); } *************** private: *** 2618,2624 **** } graphics_handle do_make_graphics_handle (const std::string& go_name, ! const graphics_handle& p); graphics_handle do_make_figure_handle (double val); --- 2618,2624 ---- } graphics_handle do_make_graphics_handle (const std::string& go_name, ! const graphics_handle& p, bool do_createfcn); graphics_handle do_make_figure_handle (double val); Index: src/graphics.cc =================================================================== RCS file: /cvs/octave/src/graphics.cc,v retrieving revision 1.70 diff -c -p -r1.70 graphics.cc *** src/graphics.cc 14 Jan 2008 08:58:02 -0000 1.70 --- src/graphics.cc 14 Jan 2008 10:57:51 -0000 *************** is_figure (double val) *** 815,820 **** --- 815,827 ---- return obj && obj.isa ("figure"); } + static void + xcreatefcn (const graphics_handle& h) + { + graphics_object obj = gh_manager::get_object (h); + obj.get_properties ().execute_createfcn (); + } + // --------------------------------------------------------------------- static int *************** gh_manager::gh_manager (void) *** 1740,1746 **** graphics_handle gh_manager::do_make_graphics_handle (const std::string& go_name, ! const graphics_handle& p) { graphics_handle h = get_handle (go_name); --- 1747,1753 ---- graphics_handle gh_manager::do_make_graphics_handle (const std::string& go_name, ! const graphics_handle& p, bool do_createfcn) { graphics_handle h = get_handle (go_name); *************** gh_manager::do_make_graphics_handle (con *** 1761,1767 **** else if (go_name == "surface") go = new surface (h, p); if (go) ! handle_map[h] = graphics_object (go); else error ("gh_manager::do_make_graphics_handle: invalid object type `%s'", go_name.c_str ()); --- 1768,1778 ---- else if (go_name == "surface") go = new surface (h, p); if (go) ! { ! handle_map[h] = graphics_object (go); ! if (do_createfcn) ! go->get_properties ().execute_createfcn (); ! } else error ("gh_manager::do_make_graphics_handle: invalid object type `%s'", go_name.c_str ()); *************** make_graphics_object (const std::string& *** 1970,1982 **** if (parent.ok ()) { graphics_handle h ! = gh_manager::make_graphics_handle (go_name, parent); if (! error_state) { adopt (parent, h); xset (h, args.splice (0, 1)); retval = h.value (); --- 1981,1994 ---- if (parent.ok ()) { graphics_handle h ! = gh_manager::make_graphics_handle (go_name, parent, false); if (! error_state) { adopt (parent, h); xset (h, args.splice (0, 1)); + xcreatefcn (h); retval = h.value (); *************** Undocumented internal function.\n\ *** 2023,2029 **** graphics_handle h = octave_NaN; if (xisnan (val)) ! h = gh_manager::make_graphics_handle ("figure", 0); else if (val > 0 && D_NINT (val) == val) h = gh_manager::make_figure_handle (val); else --- 2035,2041 ---- graphics_handle h = octave_NaN; if (xisnan (val)) ! h = gh_manager::make_graphics_handle ("figure", 0, false); else if (val > 0 && D_NINT (val) == val) h = gh_manager::make_figure_handle (val); else *************** Undocumented internal function.\n\ *** 2034,2039 **** --- 2046,2052 ---- adopt (0, h); xset (h, args.splice (0, 1)); + xcreatefcn (h); retval = h.value (); }