Re: Decorating scales



Hi,

If GtkRange were a gtk container perhaps using gtk_container_xxx with
child_properties will be an alternative. GtkContainer also has bettern
granularity - the programmers can modify/remove each marker
individually.

Unfortunately it isn't a Container.

Regards,

Yu
On Tue, 2009-01-06 at 00:31 -0500, Matthias Clasen wrote:
> Over the Christmas vacation, I spent a day adding marks to scales. The
> motivation for this came from the new sound preferences capplet, which
> uses a GtkHScale for balance control. Jon did a nice job of adding
> Left/Right labels (see the screenshot), but what is really missing
> here is an easy to hit midpoint.
> 
> So I wrote a patch for GtkRange and GtkScale that allows to add
> 'marks' to certain values. When dragging the scale over one of these
> marked values, there is a little resistance that makes it easy to
> select the exact value. The api also allows to
> show a label or icon next to the mark.
> http://bugzilla.gnome.org/attachment.cgi?id=125318&action=view shows
> the
> various possibilities.
> 
> I'd like to get this functionality into 2.16, if nobody objects, but
> I'm not entirely sure that I have managed to come up with the best
> possible api for this yet:
> 
> 
> +void              gtk_scale_add_mark           (GtkScale        *scale,
> +                                                gdouble          value,
> +                                                GtkPositionType  position);
> +void              gtk_scale_add_mark_text      (GtkScale        *scale,
> +                                                gdouble          value,
> +                                                GtkPositionType  position,
> +                                                const gchar     *markup);
> +void              gtk_scale_add_mark_icon      (GtkScale        *scale,
> +                                                gdouble          value,
> +                                                GtkPositionType  position,
> +                                                GIcon           *icon);
> +void              gtk_scale_clear_marks        (GtkScale *scale);
> 
> 
> Feedback appreciated,  Matthias
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



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