开发者

Changing the GTK Scrollbar image

开发者 https://www.devze.com 2023-01-11 22:52 出处:网络
I would l开发者_开发问答ike to change the image of GTK Scrollbar, i.e) I want to remove the standard looking scrollbar, and add my resources to it.

I would l开发者_开发问答ike to change the image of GTK Scrollbar, i.e) I want to remove the standard looking scrollbar, and add my resources to it.

I dont mind touching gtk code.

I am sure that GTK will maintain all the images as a resources,

Can any one please locate me, where to change the images?

Thanks in advance Dinesh P


The scrollbars aren't drawn in GTK; the theme engine is responsible for drawing them. In all themes that I know of, they are not drawn using image resources, but instead using GDK or Cairo.

See for example this code from the Clearlooks theme: http://git.gnome.org/browse/gtk-engines/tree/engines/clearlooks/src/clearlooks_draw_glossy.c (line 915, function clearlooks_glossy_draw_scrollbar_stepper())

If you want to use images, you will have to change a theme engine or write your own.

<standard-lecture> It's generally frowned upon to do this sort of thing in GTK; the toolkit is all about usability. Users with particular needs may have configured their themes in a particular way, for example to be compatible with a screen reader, and drawing your own customized stuff may interfere with that. At the very least, you will piss people off by breaking their desktop themes. As an application developer, you should build your application out of the widgets that GTK and other libraries provide, and the user should be free to decide how it looks on their own desktop. </standard-lecture>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号