octave-maintainers
[Top][All Lists]
Advanced

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

Re: waitbar function


From: John W. Eaton
Subject: Re: waitbar function
Date: Thu, 3 Nov 2011 11:57:41 -0400

On  3-Nov-2011, Michael Goffioul wrote:

| On Thu, Nov 3, 2011 at 9:40 AM, John W. Eaton <address@hidden> wrote:
| > I have added a graphical waitbar function to Octave.
| >
| > Doing that required several changes to the graphics code that I'm not
| > 100% confident about so there could be a few problems.  The list of
| > changesets related to the addition of this function is:
| >
| >  http://hg.savannah.gnu.org/hgweb/octave/rev/718f78b01de1
| >  http://hg.savannah.gnu.org/hgweb/octave/rev/760e4e88dba3
| 
| You should be able to achieve the same by simply calling
| get_bounding_box() method, instead of exposing static functions.
| Moreover, the get_bounding_box() method also handle the 1-based
| indexing as well as Y-direction flipping ((1,1) corresponds to the
| bottom-left corner of the screen).

Thanks, I didn't see that method.  I checked in the following
additional changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/4f112bebd474

| >  http://hg.savannah.gnu.org/hgweb/octave/rev/5acb5c25e4ae
| >  http://hg.savannah.gnu.org/hgweb/octave/rev/195ff3561152
| 
| Could you explain why you need non-integer figure handles?

It seems to be what Matlab does.  Also, I think people would expect a
sequence like

  figure (..)
  waitbar (..)
  figure (..)

to generate figures 1 and 2, not 1 and 3.

| >  http://hg.savannah.gnu.org/hgweb/octave/rev/d7d14f1a4c4d
| >  http://hg.savannah.gnu.org/hgweb/octave/rev/a2e158c3451f
| 
| - You typically use NaN as first argument of __go_figure__. Oh, I see
| that you actually use that to produce a non-integer figure handle

Right, it's a bit of a kluge, but I thought it was better than
trying to use a separate argument for this purpose.

| - Wouldn't it be more efficient to modify the properties of the
| existing patch object, instead of recreating a new one?

Yes, probably, but I'm not that good with the graphics stuff and it
didn't occur to me that it would work...

Also, when I try the following, the patch color disappears after the
xdata property is updated.  Is there something else I have to do other
than setting the xdata property?

  frac = 0.1;
  p = patch ([0, frac, frac, 0], [0, 0, 1, 1], [0, 0.35, 0.75]);
  frac = 0.9
  p = patch ([0, frac, frac, 0], [0, 0, 1, 1], [0, 0.35, 0.75]);

Also, with gnuplot, the above fails with the error

  error: horizontal dimensions mismatch (1x1 vs 4x1)
  error: called from:
  error:   .../plot/private/__go_draw_axes__.m at line 767, column 34
  error:   .../plot/private/__go_draw_figure__.m at line 167, column 19
  error:   .../plot/__gnuplot_drawnow__.m at line 86, column 5

| Matlab doesn't have any status bar in the figure window. But maybe you
| could use the "toolbar" figure property to hide the statusbar in FLTK
| window?

OK.  I was thinking about adding a separate hidden property, but it
seems reasonable to user the toolbar property for this purpose.
Anyway, this part of the figure window has some buttons so I suppose
it is a sort of a toolbar.

Thanks,

jwe


reply via email to

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