使用扩展器创建GTK Widget [英] Creating GTK Widget Using Expander

查看:75
本文介绍了使用扩展器创建GTK Widget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在下面的图片中创建GTK Widget:

我试过使用GtkExpander,但它不工作...



可以任何一个帮助....

解决方案

如果你想要复制外观,那么问题有两种效率非常低的解决方案:


  1. 编写您自己的GTK主题引擎(请参阅Murrine或Clearlooks)。

  2. GtkDrawingArea 小部件替换整个程序,并使用Cairo精确绘制所需的外观。然而,当然,您将自行创建,因此您必须从头开始编写所有窗口小部件布局算法,按钮,扩展程序,菜单和其他内容。

GTK并不是真的用于这类事情。 GTK的重点在于,您可以使用标准小部件来设计用户界面,并且只需使用用户需要使用的任何主题,语言或辅助功能技术。如果您设计自己的外观并且无法改变它,那么色盲或视力差的人将无法使用它。或者如果有人使用其他语言的应用程序,文本将会全部错位。或者至少,也许有人只是喜欢黑色桌面上的白色字体,而且你的应用程序会在用户的计算机上伸出来,看起来很丑。如果你真的需要使它看起来完全一样,那么GTK可能不适合你。


I am trying to create GTK Widget like shows in following Images

Is it possible to create it in GTK+ under C, I tried using GtkExpander but it is not working out ...

Can any one Help....

解决方案

If what you want is to duplicate the look, then there are two very inefficient solutions to the problem:

  1. Write your own GTK theme engine (see Murrine or Clearlooks).
  2. Replace your entire program by a GtkDrawingArea widget and use Cairo to draw exactly the look you want. You'll be on your own then, though, so you'll have to write all your widget placement algorithms, buttons, expanders, menus, and whatnot, from scratch.

GTK isn't really meant for this sort of thing. The whole point of GTK is that you design your user interface with the standard widgets, and they just work with whatever theme, language, or accessibility technologies your users need to use. If you design your own look and there's no way to change it, then someone with color blindness or poor eyesight won't be able to use it. Or the text will get all misaligned if someone uses your application in another language. Or at the very least, maybe someone just likes a black desktop with white lettering, and your application will stick out and look really ugly on that user's computer. If you really need to make it look exactly that way, then probably GTK isn't the right tool for you.

这篇关于使用扩展器创建GTK Widget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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