GTK +应用程序特定的皮肤可能吗? [英] GTK+ application specific skin possible?

查看:238
本文介绍了GTK +应用程序特定的皮肤可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用GTK +和Vala,并且很难找到创建自定义按钮的文档(全新的按钮)。事实上,现在我想到了,每个GTK +应用程序都具有不同的外观,这就是GTK +应用程序。如果我决定使用GTK +,那么为我的应用程序创建一个全新的外观很困难吗?解析方案

您可以使用 GTK2_RC_FILES 环境变量为您的应用程序分配一个特殊的主题。



例如,您可以创建一个批量启动器(Windows)如下:

  set GTK2_RC_FILES =%GTK_HOME%\share\themes\slickness-black\gtk -2.0\gtkrc 
launch.exe

或者在Linux中(没有尝试过一个):

$ p $ env GTK2_RC_FILES = / usr / share / themes / slickness-black / gtk-2.0 / gtkrc ./launch

提示:不要相信要设置GTK_HOME,而要使用GTK +安装的绝对路径。如果您在应用程序中安装了特殊主题,则可以使用相对路径(相对于您的应用程序的安装路径)。那么你应该确保这个主题是由一个最常见的主题引擎支持的,因为通常不是所有主题都被安装(特别是在Windows上,GTK安装程序很混乱)。


I've started working with GTK+ and Vala and am having a hard time finding documentation on creating custom buttons (totally new looking buttons). In fact now that I think about it, every GTK+ application has that distinct look that gives away that it's a GTK+ app. Is it difficult to create a totally new look for my application if I decide to use GTK+?

解决方案

You can use the GTK2_RC_FILES environment variable to assign a special theme to (only) your application.

For example, you can create a batch starter (Windows) like so:

set GTK2_RC_FILES=%GTK_HOME%\share\themes\slickness-black\gtk-2.0\gtkrc
launch.exe

Or in Linux (haven't tried that one):

env GTK2_RC_FILES=/usr/share/themes/slickness-black/gtk-2.0/gtkrc ./launch

Hint: Don't trust in GTK_HOME to be set, rather use the absolute path of the GTK+ installation. If you install a special theme with your application, it might be possible to use a relative path (relative to the installation path of your app). Then you should make sure that the theme is supported by one of the most common theme engines because usually not all of them are installed (especially on Windows, where GTK installers are a mess).

这篇关于GTK +应用程序特定的皮肤可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆