首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关键错误:在加载我的xfce插件时,没有足够的参数传递给包装器。

关键错误:在加载我的xfce插件时,没有足够的参数传递给包装器。
EN

Stack Overflow用户
提问于 2016-09-05 18:06:31
回答 1查看 363关注 0票数 2

我编写了一个非常简单的xfce面板插件片段:

代码语言:javascript
复制
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>

static void system_monitor_construct(XfcePanelPlugin *plugin);

XFCE_PANEL_PLUGIN_REGISTER(system_monitor_construct);

static void system_monitor_construct(XfcePanelPlugin *plugin)
{
    GtkWidget *hvbox;
    GtkWidget *label;
    GtkOrientation  orientation;

    orientation = xfce_panel_plugin_get_orientation (plugin);
    hvbox = xfce_hvbox_new (orientation, FALSE, 2);
    gtk_widget_show(hvbox);

    gtk_container_add (GTK_CONTAINER (plugin), hvbox);

    label = gtk_label_new ("Hello GNOME!");
    gtk_container_add (GTK_CONTAINER (hvbox), GTK_WIDGET (label));
    gtk_widget_show(label);

}

它是用下列内容汇编的:

代码语言:javascript
复制
gcc -Wall -shared -o libtest.so -fPIC main.c `pkg-config --cflags --libs libxfce4panel-1.0` `pkg-config --cflags --libs gtk+-2.0`

libtest.so复制到/usr/lib/xfce4/panel-plugins,并在/usr/share/xfce4/panel-plugins中创建桌面文件test.desktop,内容如下:

代码语言:javascript
复制
[Xfce Panel]
Type=X-XFCE-PanelPlugin
Encoding=UTF-8
Name=test
X-XFCE-Module=test
X-XFCE-Module-Path=/usr/lib/xfce4/panel-plugins

当我加载这个插件时,我得到:

代码语言:javascript
复制
(process:5700): xfce4-panel-wrapper-CRITICAL **: Not enough arguments are passed to the wrapper
xfce4-panel(external): test-8: child exited with status 512

(xfce4-panel:5695): xfce4-panel-WARNING **: Plugin test-8 exited with status 2, removing from panel configuration
xfce4-panel(external): test-8: plugin unrealized; quiting child
xfce4-panel(application): saving /panels/panel-2: ids=true, providers=false

(xfce4-panel:5695): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed

(xfce4-panel:5695): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkObject'

(xfce4-panel:5695): exo-CRITICAL **: IA__exo_gtk_object_destroy_later: assertion 'GTK_IS_OBJECT (object)' failed

我哪里错了?或者我错过了什么?

EN

回答 1

Stack Overflow用户

发布于 2016-09-06 17:52:48

试着尝试..。此问题是由于Comment条目丢失在桌面文件中引起的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39335736

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档