Re: Foobar patch



Chris Phelps <chicane reninet com> writes:
> there might be some balking on #1 due to its
> usage of usize (since it is deprecated and all...), 

Things that are deprecated are either a bad idea to use, or have a
replacement. So you shouldn't use them. ;-) That's the idea of
deprecation.

Oddly enough the replacement for set_usize() is documented:

  http://developer.gnome.org/doc/API/2.0/gtk/gtkwidget.html#GTK-WIDGET-SET-USIZE

(Thanks to some cool people like Matthias Clasen, 85% of GTK functions
are documented, and most of what isn't is stuff you probably don't care about...)

> and the possibility 
> of the label needing to change size if the font
> is changed.

> +		width = > gdk_string_width(foo->clock_label->style->private_font, hour);

Eeeeaaggghh garrrghh - you're using broken/deprecated API _and_ a
private struct field that _has private in the name_. Dude.

Anyway, it's private because it is not guaranteed to be non-NULL. Plus
gdk_string_width() does _not_ give accurate results for the width of a
PangoLayout, which is why it's deprecated.

/me hands Chris the manual:
  http://developer.gnome.org/doc/API/2.0/gtk/gtkstyle.html#GTK-STYLE-GET-FONT
  http://developer.gnome.org/doc/API/2.0/pango/pango-layout-objects.html#PANGO-LAYOUT-GET-PIXEL-SIZE
  http://developer.gnome.org/doc/API/2.0/gtk/gtkwidget.html#GTK-WIDGET-CREATE-PANGO-LAYOUT
  http://developer.gnome.org/dotplan/porting/ar01s10.html

Havoc



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