Re: [gtk-list] Re: Vertical rulers



> > 
> > Whilst on the subject of rulers, is there a reason why the don't use
> >  adjustments, like scrollbars, scales, spin-buttons and viewports. It would
 make
> >  life more consistent if they did - or have I missed something ?
> 
> Well scrollbars, scales, spin-buttons and viewports don't do the same
> thing as rulers do. In my application I draw a graph on a drawing area.
> When the user moves the mouse over the graph he should be able to tell on
> what coordinates he is. Sure, I could just use some label telling him the
> coordinates, but rulers are at least a good-looking complement.
> 
> I use scrollbars, but how could I replace my rulers with scales,
> spin-buttons or viewports?
> 
> /Johan Levin
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


scrollbars, scales, and spin-buttons all control (i.e. may update) the value of
 a scalar model - the adjustment, they also view it (i.e. if it changes, they
 update the value they are displaying).

The viewport may be attached to a couple of these attachments (x and y axis) in
 order to determine it's virtual origin - i.e. it 'views' (but not controls - as
 far as I can make out) these adjustments.

If a ruler controlled an adjustment, we could hook other objects expecting
 scalar models in the form of adjustments to it. e.g. you could hook a couple of
 rulers, to a couple of adjustments, to a viewport and by moving your mouse
 around between the two rulers, the viewport would scroll automagically to the
 right place (assuming you sorted out your coordinate transforms properly). You
 would be able to position yourself, exactly where you wanted on a ruler by
 typing into a spin-box that was controlling the same model/adjustment as the
 ruler etc.


This is all basically MVC stuff - do a search for it on the web if you need more
 information - look for Model View Controller.

So given that our scalar model is an adjustment, it seems a pity that the ruler
 widgets, which deal in terms of the same sort of thing, may not be hooked up to
 one.


Does that clarify the point ?



Jules



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