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

 
 

bug #31121: output of callback not directly printed

Submitted by:  Kai Habel <kahacjde>
Submitted on:  Sat 25 Sep 2010 12:41:50 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Kai HabelOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 17 Oct 2013 04:54:37 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup