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 Sep 25 12:41:50 2010  
 
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 Oct 9 05:24:02 2013, 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 Oct 9 12:50:20 2010, 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 Sep 30 19:29:00 2010, 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 Sep 30 19:08:47 2010, 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 Sep 27 07:20:24 2010, 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 Sep 26 12:38:23 2010, 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 Sep 25 21:06:58 2010, 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 Sep 25 12:48:46 2010, comment #1:

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

Kai

Kai Habel <kahacjde>
Project Member
Sat Sep 25 12:41:50 2010, 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 Oct 17 16:54:37 2013rik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup