Re: Proposal of a Bonobo::Zoomable interface



Martin Baulig <martin home-of-linux org> writes:

> 
> Note that I made the "zoom_level" attribute read-only as well:
> 
> 1.) The component may not be able to zoom to exactly the requested zoom
>     level but may need to change it.

We were actually using the attribute this way already; when you set
it, it snaps to the closest valid value.

> 
> 2.) Changing the zoom level is an async operation and may take a while
>     to complete.

Good thinking.
 
> So there's now a `set_zoom_level' method; when it is invoked, the component
> will zoom to the requested zoom level, set the "zoom_level" attribute to
> its actual current zoom level and then invokes the `report_zoom_level_changed'
> method on the Bonobo::ZoomableFrame.
> 
> When any of the other parameters is changed, the `report_zoom_parameters_changed'
> method will be used to inform the container about it.
> 

In Nautilus we considered going even further and combining this with
the zoom level callback, since if you change the range such that the
current zoom level is illegal, you might want the min, max and current
to all change together as an atomic operation. However, that's
inconvenient in the client case. Perhaps
`report_zoom_parameters_changed' could imply a possible zoom level
change as well.

Another possible extension is multiple listeners/frames.

 - Maciej




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