octave-maintainers
[Top][All Lists]
Advanced

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

Re: 2 items about fltk backend


From: Shai Ayal
Subject: Re: 2 items about fltk backend
Date: Wed, 2 Dec 2009 23:20:12 +0200

On Wed, Dec 2, 2009 at 7:38 PM, Michael D. Godfrey
<address@hidden> wrote:
> On 12/2/09 6:21 PM, Shai Ayal wrote:
>>
>> What you report is strange since in the fltk_backend drawnow is not
>> done in a separate thread (like gnuplot), so it should end only after
>> the file does exist. I'll try to investigate later.
>>

The following patch to fltk_backend solves the missing file problem
for me. Can you verify?

--- a/src/DLD-FUNCTIONS/fltk_backend.cc
+++ b/src/DLD-FUNCTIONS/fltk_backend.cc
@@ -67,6 +67,9 @@

 #define FLTK_BACKEND_NAME "fltk"

+// give FLTK no more than 0.01 sec to do it's stuff
+static double fltk_maxtime = 1e-2;
+
 const char* help_text = "\
 Keyboard Shortcuts\n\
 a - autoscale\n\
@@ -299,6 +302,11 @@
   void print (const std::string& fname)
   {
     canvas->print (fname);
+
+    // we want to print immediately so the output file can be relied
+    // upon to exist when the drawnow command is over
+    mark_modified ();
+    Fl::wait (fltk_maxtime);
   }

   void mark_modified (void)
@@ -843,8 +851,6 @@
 int figure_manager::curr_index = 1;

 static bool backend_registered = false;
-// give FLTK no more than 0.01 sec to do it's stuff
-static double fltk_maxtime = 1e-2;

 static int
 __fltk_redraw__ (void)


reply via email to

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