严重错误:加载我的xfce插件时,没有足够的参数传递给包装器

时间:2016-09-05 18:06:32

标签: gtk gtk2 xfce

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

@"group.com.myCompanyAppStore.myApp"

编译它:

#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);

}

libtest.so 复制到gcc -Wall -shared -o libtest.so -fPIC main.c `pkg-config --cflags --libs libxfce4panel-1.0` `pkg-config --cflags --libs gtk+-2.0` ,并在/usr/lib/xfce4/panel-plugins中创建包含以下内容的桌面文件 test.desktop

/usr/share/xfce4/panel-plugins

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

[Xfce Panel]
Type=X-XFCE-PanelPlugin
Encoding=UTF-8
Name=test
X-XFCE-Module=test
X-XFCE-Module-Path=/usr/lib/xfce4/panel-plugins

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

1 个答案:

答案 0 :(得分:1)

尝试后尝试...此问题是由于桌面文件中缺少Comment条目引起的。