简体   繁体   English

如何在Pygi中使用Xfce小部件?

[英]How do I use Xfce widgets with Pygi?

I've been playing around with pygi recently, trying to put together a mixer plugin for xfce, but when I try to load the GtkBuilder file from python it doesn't recognize the XfceTitledDialog (which I'm trying to use for the configuration dialog). 我最近一直在与pygi一起玩,试图为xfce组合一个混音器插件,但是当我尝试从python加载GtkBuilder文件时,它无法识别XfceTitledDialog(我正在尝试将其用于配置对话框) )。

Is there something special I need to do to use xfce widgets? 使用xfce小部件需要做些特别的事情吗?

Here's what I've got so far: 到目前为止,这是我得到的:

Python 2.7 (r27:82500, Aug 07 2010, 16:54:59) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gtk,Gdk
>>> builder = Gtk.Builder()
>>> builder.add_from_file('xfvol.ui')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/types.py", line 40, in function
    return info.invoke(*args)
RuntimeError: Invalid object type `XfceTitledDialog'

Changing XfceTitledDialog to GtkDialog makes it work, but it's the wrong widget. 将XfceTitledDialog更改为GtkDialog使其可以工作,但这是错误的小部件。
The widget is available and appears to work in Glade. 该小部件可用,并且似乎可以在Glade中使用。

Try setting some shell environment variables that glade needs. 尝试设置一些林间空地需要的外壳环境变量。

GLADE_PIXMAP_PATH=/usr/share/glade3/pixmaps
GLADE_CATALOG_PATH=:/usr/share/glade3/catalogs
GLADE_MODULE_PATH=:/usr/lib64/glade3/modules
LIBGLADE_MODULE_PATH=/usr/lib64/libglade/2.0

Make sure those are the right paths on your system and the the xfce modules are in there. 确保这些是您系统上正确的路径,并且xfce模块位于其中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM