octave-maintainers
[Top][All Lists]
Advanced

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

Re: Edit-Grid doesn't work


From: Andreas Weber
Subject: Re: Edit-Grid doesn't work
Date: Tue, 29 Jul 2014 21:27:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0

Am 29.07.2014 16:53, schrieb Rik:
> On 07/29/2014 01:05 AM, Andreas Weber wrote:
>> Am 29.07.2014 09:06, schrieb Rik:
>>> On 07/28/2014 10:58 PM, Andreas Weber wrote:
>>>> Am 29.07.2014 05:41, schrieb Rik:
>>>>> On 07/28/2014 09:01 AM, address@hidden wrote:
>>>>> I remarked on this before as well.  You can get it to work by causing
>>>>> the event loop to run.  For example, if you return to the command window
>>>>> and hit <RETURN> the grid will appear.  We need to use the same solution
>>>>> that was used for the 'g'.  In this case, I just added a drawnow ()
>>>>> command at the end of the grid_cb function in __add_default_menu__ and
>>>>> it works correctly.
>>>> Hi Rik, does this still not work correctly after changeset b2db129c664d?
>>> It still didn't work.  I used the following test code
>>>
>>> plot (1:10)
>>> Edit->Toggle grid on all axes
>> This works for me (and always had). Which fltk version do you use? I
>> have 1.3.2-5 in debian jessie.
> 
> I'm using version 1.3.0-5 in Linux Mint 13 (really Kubuntu 12.04 LTS).
> 
>>
>>> I just added a drawnow call to get it to work.
>> I hesitate to do this immediately because this may shadow the real
>> problem. If you add
>>
>> +++ b/scripts/plot/util/private/__add_default_menu__.m  Tue Jul 29
>> 09:46:24 2014
>> @@ -97,6 +97,7 @@
>>  endfunction
>>
>>  function grid_cb (h, e)
>> +disp("this is grid_cb"); fflush(stdout);
>>    hax = __get_axes__ (h);
>>
>> Do you see the msg when clicking on Menu->Toggle grid on all axes?
>> And if the grid doesn't appear, can you move the window outside the
>> screen and back (this causes a fltk redraw).
> 
> I do see the disp statement so the callback is being executed.
> 
>>
>> I hope you understand that I just want to grasp the cause for this
>> problem and to my understanding the event propagation after grid_cb
>> should be:
>>
>> grid.m:  set (hax, "xgrid", "on", "ygrid", "on", "zgrid", "on",
>> graphics.h: void set_xgrid (const octave_value& val): mark_modified ();
>>
>> which should do the toolkit notification and then trigger the redraw.
> 
> Isn't the redraw done when the event loop is called which has Fl::check?

The actual redraw is executed from Fl::check which is called from
__fltk_redraw__ which gest called per input_event_hook.

The FLTK damage flag which signals FL:check that a redraw should be done
is set with mark_modified (canvas->redraw ()) and this can be set from
"outside" with redraw_figure which is called from drawnow.

> I think the grid is correctly being marked as modified, but it isn't
updated
> until a Octave calls for an update which it does after processing each
> command line.  I think this is why hitting <RETURN> or entering any
> statement on the command window such as "a=1" works.

And this was my problem: I thought axes::properties::mark_modified would
cause a drawnow but it just sets a flag that it needs to be redrawn.

Anyway, the right solution is to add drawnow in the grid and axis_auto
callback as suggested.

I also found the reason why it works for me without redraw:
With XFCE a redraw it triggered when the menubar item hides a part of
the canvas and the collapses.

This should fix this issue:
http://hg.savannah.gnu.org/hgweb/octave/rev/0257a936dc4a

-- Andy



reply via email to

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