bugGNU Octave - Bugs: bug #31121, output of callback not directly...

 
 

bug #31121: output of callback not directly printed

Submitter:  Kai Habel <kahacjde>
Submitted:  Sat 25 Sep 2010 12:41:50 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Kai Habel Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 09 Oct 2013 05:24:02 AM UTC, comment #8: 

This bug report is 3 years old.  Is it still present?  At least for me, when I turn off pager output, I get the results of the callback immediately.

Rik <rik5>
Group administrator
Sat 09 Oct 2010 12:50:20 PM UTC, comment #7: 

I am not sure if I understand you correctly.
It think drawnow should be called after a callback execution, but only when the graphic changes (e.g. 'grid' in comment #3). If you mean that drawnow should be called after each callback, then I don't think this is the right approach.

Kai Habel <kahacjde>
Group Member
Thu 30 Sep 2010 07:29:00 PM UTC, comment #6: 

OK, I see that FL_PUSH is called, but drawnow is not, at least until there is input at the command prompt.  So, are we supposed to also be calling drawnow after each mouse event?  After a callback is executed?  If I knew when it was supposed to be called, I could probably fix the problem.

John W. Eaton <jwe>
Group administrator
Thu 30 Sep 2010 07:08:47 PM UTC, comment #5: 

I have added some debug statements to see if the mouse events 'FL_PUSH' are being processed. As far as I can see all mouse clicks are captured and processed correctly in fltk_backend.cc.

Also gh_manager::do_execute_callback (...) is called after a mouse click - independent of pager settings.

So I don't think the problem is on the fltk side.

Kai

Kai Habel <kahacjde>
Group Member
Mon 27 Sep 2010 07:20:24 AM UTC, comment #4: 

Odd, with the grid example you posted, I see it sometimes working without needing to press enter.  But yes, there does seem to be some problem with processing events.  We are supposed to be doing that in the readline idle loop.  See the definition of the _init_fltk_ and _fltk_redraw_ functions in src/DLD-FUNCTIONS/fltk_backend.cc.

I don't know enough about FLTK to know whether the problem is that we are not processing events properly, or that they are not being queued properly and noticed by FLTK.

John W. Eaton <jwe>
Group administrator
Sun 26 Sep 2010 12:38:23 PM UTC, comment #3: 

Even if I turn off the pager, I have to press enter to get back to the command prompt.

The same or a related problem occurs if I use grid as callback function.

function myfun
  figure(1)
  set(1,'windowbuttondownfcn','grid')
end

The callback is executed only when I press enter at the command line and this is independent of the pager setting.

Kai

Kai Habel <kahacjde>
Group Member
Sat 25 Sep 2010 09:06:58 PM UTC, comment #2: 

Output from disp goes through the pager, so this seems like normal behavior to me.  If I turn off the pager, I see the output immediately.  But maybe the rules for terminal output should be different if the output is coming from a callback?  Or we should flush pending output when events are processed?  I don't know, but both of those options seem complicated to me and could cause some confusion if there is other output pending.  Maybe it is better to just turn off the pager if you want to see the output immediately?

John W. Eaton <jwe>
Group administrator
Sat 25 Sep 2010 12:48:46 PM UTC, comment #1: 

Of course, you have to click into figure 1 to execute the callback.

Kai

Kai Habel <kahacjde>
Group Member
Sat 25 Sep 2010 12:41:50 PM UTC, original submission:  

If you have the function 'myfun' as follows defined:
------------------
function myfun
  figure(1)
  set(1,'windowbuttondownfcn',@myfcn)
end

function myfcn(o,e)
  o,e
  disp('button down')
end
---------------
and call myfun, the output is not printed directly, only after one presses enter at the command window.

session copy:
------------------
octave:2> myfun
octave:3>
o =  1
e = [](0x0)
button down
octave:3>
---------------

Kai Habel <kahacjde>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by kahacjde (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-17 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code