Re: vslider min at bottom



> From: Jim Edwards <jimedwards altavista com>
>
> Ron Steinke wrote:
>
> > > From: Jan-Marek Glogowski <glogow stud fbi fh-darmstadt de>
> > >
> > > Hi Jim
> > >
> > > > How do you specify that the minimum value of a vslider should be at the
> > > > bottom rather than the top?   On a similar topic , can i make a slider
> > > > work on a logarithmic scale?
> > >
> > > As Havoc wrote it's not possible directly. But you can "map" the values of
> > > the slider, when you connect a signal to GtkAdjustment "value-changed" event.
> > >
> > > So my solution would be
> > >
> > > - define th adjustment from 0 .. 100.
> > > - on the event make 100 - value and store it somwhere, where other
> > > funtions, which need the value of the slider can get it. Now you have
> > > slider with the min value at the bottom.
> > >
> > > Something similar applies to your logar logarithmic scale.
> >
> > And if you want to be exceptionally clever, you can make a new object
> > derived from GtkAdjustment which implments this as a new signal.
> >
> >
>
> I thought i was doing really good just to turn off the print of the slider value
> and replace it with a label that I update
> with my derived value.  I'm still a bit baffled by inheritance in Gtk but I do
> want to learn - care to send this out as an example?

Try looking at the tutorial on www.gtk.org. It has a section which describes
exactly how to do this.

Ron




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