toolbar issues

Hi, I was trying to make updating plot not cause to change

    > zoom. I have wxPython program with embedded plot and I
    > can change some parameters what makes some changes on the
    > plot. User should be able to zoom and then change these

What do you mean by updating plot -- calling a plot command? Calling
"plot" and related functions does autoscale the axes -- is this the
problem you are referring to? It might be useful to add and
autoscale=False option, much in the way we have a hold=True|False
option, to the plot command, so one could issue a plot command w/o
changing the current view lim.

I ready through your post several times but still am not quite sure
what problem you are describing. Could you elaborate? Could you be
more specific: what are the "parameters" for example?

    > parameters and see how it influences plot, OTOH it should
    > be easy to show whole plot, eg. using home button.
    > Perhaps I'm wrong, but I think its quite common
    > requirement.

    > BTW pressing home button calls toolbar's draw() twice:

OK, I'll fix this. Thanks.

    > And why wx and gtk toolbars are different -- in GTK button
    > descriptions are in tooltips and x,y position is displayed
    > in toolbar, and in wx statusbar is used? Are they
    > different by design? I prefer the first way, without
    > statusbar.

This is mainly due to historical accident. He who write the backend
generally does it the way they want. The wx backend was the 2nd GUI
ever and there was no policy. Since then we've worked to make the
interface between the backends fairly uniform but there are some
historical differences. I don't feel strongly about it, but am
amenable to accepting a patch to change wx to behave like the other
backends.

    > And last thing: what do you think about making toolbar2
    > more hmm.. interactive(?), i mean disabled back/forward
    > buttons whan there is no history, pressed pan/zoom buttons
    > when in pan/zoom mode etc? I don't know if I'll try to do
    > it, but if someone would do it, would it be included in
    > MPL?

Yes, this would be nice. I think fltk already does this. It's mainly
a matter of getting to this to work on each and every backend. I
think Steve and I both looked at this for gtk, but couldn't an easy
way to do this. Part of the problem, I think, is that mpl is using
custom images for these buttons and it wasn't clear to me how to
indicate "pressed" status with button relief, etc... Patches gladly
accepted.

JDH

John Hunter wrote:

What do you mean by updating plot -- calling a plot command? Calling

Yes

"plot" and related functions does autoscale the axes -- is this the
problem you are referring to?

Yes, that was the problem.

It might be useful to add and
autoscale=False option, much in the way we have a hold=True|False
option, to the plot command, so one could issue a plot command w/o
changing the current view lim.

Yes, but I would also like to allow user explicitly autoscale, ie. show
whole plot when when pressing home (or another) button.
So I don't want to change the current view lim when calling plot command,
but I want to know what the new data lims are, to be able to use it later.

Marcin

···

--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr

    > And last thing: what do you think about making toolbar2
    > more hmm.. interactive(?), i mean disabled back/forward
    > buttons whan there is no history, pressed pan/zoom buttons
    > when in pan/zoom mode etc? I don't know if I'll try to do
    > it, but if someone would do it, would it be included in
    > MPL?

Yes, this would be nice. I think fltk already does this. It's mainly

I haven't installed fltk, but had a look at code, and I think it does
toggled pan/zoom buttons, but not enabled/disabled back/forward.

a matter of getting to this to work on each and every backend. I
think Steve and I both looked at this for gtk, but couldn't an easy
way to do this. Part of the problem, I think, is that mpl is using
custom images for these buttons and it wasn't clear to me how to
indicate "pressed" status with button relief, etc... Patches gladly
accepted.

Proposition of the patch is attached.

BTW could you have a look at
http://sourceforge.net/mailarchive/forum.php?thread_id=7056275&forum_id=36187
Does it makes a sense?

Marcin

toolbar.diff (6.83 KB)

···

On Sun, 1 May 2005, John Hunter wrote:

--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr/