octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Changeset]: Re: cla() ?


From: David Bateman
Subject: Re: [Changeset]: Re: cla() ?
Date: Tue, 07 Oct 2008 13:55:48 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

Michael Goffioul wrote:
On Tue, Oct 7, 2008 at 1:25 PM, Ben Abbott <address@hidden> wrote:
Hi Michael,

You are certainly correct. I was stuck in the context of Octave prior to the
objects and properties. Thanks.

Regarding __go_delete__, I'm not proficient in c++. Can you make this
change?

Honestly, no. I'm completely overbooked for the next couple of
weeks (at least until beginning of November).

Michael.

Hey, its a pretty trivial patch, and i attach it here...

D.


--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary

# HG changeset patch
# User David Bateman <address@hidden>
# Date 1223382217 -3600
# Node ID 7c81fecfe3f081b7926c7c6635484329f62a7a4c
# Parent  ec94fee5e23488f98dd45d36d5535024446a0be7
Allow arrays of graphic handles to F__go_delete__

diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-07  David Bateman  <address@hidden>
+
+       * graphics.cc (F__go_delete__): Allow arrays of graphic handles
+
 2008-10-01  Jaroslav Hajek <address@hidden>
 
        * OPERATORS/op-i64-i64.cc: Instantiate all 64-bit operations.
diff --git a/src/graphics.cc b/src/graphics.cc
--- a/src/graphics.cc
+++ b/src/graphics.cc
@@ -4419,32 +4419,40 @@
     {
       graphics_handle h = octave_NaN;
 
-      double val = args(0).double_value ();
-
-      if (! error_state)
-       {
-         h = gh_manager::lookup (val);
-
-         if (h.ok ())
-           {
-             graphics_object obj = gh_manager::get_object (h);
-
-             graphics_handle parent_h = obj.get_parent ();
-
-             graphics_object parent_obj = gh_manager::get_object (parent_h);
-
-              // NOTE: free the handle before removing it from its parent's
-              //       children, such that the object's state is correct when
-              //       the deletefcn callback is executed
-
-             gh_manager::free (h);
-
-             parent_obj.remove_child (h);
-
-             Vdrawnow_requested = true;
-           }
-         else
-           error ("delete: invalid graphics object (= %g)", val);
+      const NDArray vals = args (0).array_value ();
+
+      if (! error_state)
+       {
+         for (octave_idx_type i = 0; i < vals.numel (); i++)
+           {
+             h = gh_manager::lookup (vals.elem (i));
+
+             if (h.ok ())
+               {
+                 graphics_object obj = gh_manager::get_object (h);
+
+                 graphics_handle parent_h = obj.get_parent ();
+
+                 graphics_object parent_obj = 
+                   gh_manager::get_object (parent_h);
+
+                 // NOTE: free the handle before removing it from its parent's
+                 //       children, such that the object's state is correct
+                 //       when the deletefcn callback is executed
+
+                 gh_manager::free (h);
+
+                 parent_obj.remove_child (h);
+
+                 Vdrawnow_requested = true;
+               }
+             else
+               {
+                 error ("delete: invalid graphics object (= %g)", 
+                        vals.elem (i));
+                 break;
+               }
+           }
        }
       else
        error ("delete: invalid graphics object");

reply via email to

[Prev in Thread] Current Thread [Next in Thread]