Re: Decorating scales



On Tue, 2009-01-06 at 00:31 -0500, Matthias Clasen wrote:
> Over the Christmas vacation, I spent a day adding marks to scales.

I can't speak to the implementation, but this is a lovely initiative.
I've long wished for something like this.

++

As a related matter; do you think that there would be a reasonable way
to clamp the GtkScale so that only values with marks could be selected?
[is that what you have in mind already?]

Right now I have an application where I am using a using an GtkHScale to
select a minute value [as in hour:minute time] but restricting it to
0, 5, 30, 45, (and 59, since I'm not wrapping). The code I'm using is
this in a GtkRange 'value-changed' handler is something like this:

    current = minute.getValue();

    if ((current > 0) && (current < 8)) {
        minute.setValue(0);
    } else if ((current >= 8) && (current < 23)) {
        minute.setValue(15);
    } else if ((current >= 23) && (current < 38)) {
        minute.setValue(30);
    } else if ((current >= 38) && (current < 53)) {
        minute.setValue(45);
    } else if ((current >= 54) && (current < 60)) {
        minute.setValue(59);
    }

which does work but did seem a tad overbearing. {shrug}; at some point
you've just gotta write code.

I didn't think anything more of it until I saw you implementing marks,
so I figured I would ask.

Nice work.

AfC
Sydney

Attachment: signature.asc
Description: This is a digitally signed message part



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