2011-09-15 16 views
2

私はパネルアプレットを作成しようとしていますが、私は最初のステップでこだわっている: 私はhttp://developer.gnome.org/panel-applet/3.0/getting-started.example.htmlGNOMEフォールバックアプレットC++

#include <gtk/gtk.h> 
#include <panel-applet.h> 

static gboolean 
hello_world_applet_start (PanelApplet *applet) 
{ 
    GtkWidget *label; 

    label = gtk_label_new ("Hello World"); 
    gtk_container_add (GTK_CONTAINER (applet), label); 
    gtk_widget_show_all (GTK_WIDGET (applet)); 

    return TRUE; 
} 

static gboolean 
hello_world_factory_callback (PanelApplet *applet, 
           const gchar *iid, 
           gpointer  data) 
{ 
    gboolean retval = FALSE; 

    if (g_strcmp0 (iid, "HelloWorldApplet") == 0) 
     retval = hello_world_applet_start (applet); 

    return retval; 
} 

PANEL_APPLET_OUT_PROCESS_FACTORY ("HelloWorldFactory", 
            PANEL_TYPE_APPLET, 
            hello_world_factory_callback, 
            NULL) 
で公式の例のコードでfile.cppを作成しました

g++ -Wall -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE `pkg-config --cflags --libs gtk+-3.0 libpanelapplet-4.0` *.cpp -o helloworld 

してコンパイルし、

/usr/lib/gnome-panel/helloworld 

下にコピーし、私はしましたこのコンテンツをファイル

/usr/share/gnome-panel/4.0/applets/helloworld.panel-applet 

を作成しました:

[Applet Factory] 
Id=HelloWorldFactory 
InProcess=true 
Location=/usr/lib/gnome-panel/helloworld 
Name=Hello World Applet Factory 
Description=Factory for the window navigation related applets 

[HelloWorldApplet] 
Name=Hello World 
Description=Factory for the Hello World applet example 
Icon=hello-world-icon 

すべてのコードがドキュメントから取られているが、私はパネルにアプレットを追加しようとしたとき、私はこのエラーがありました。

** (gnome-panel:24803): WARNING **: Failed to load applet HelloWorldFactory::HelloWorldApplet: /usr/lib/gnome-panel/helloworld: cannot dynamically load executable 

何が問題なのですか?

答えて

0

あなたのコードにPANEL_APPLET_OUT_PROCESS_FACTORYを使用していて、それをInProcess=trueと記述しています。

今私はあなたの質問が私によく見えていることを実感しました。あなたはalready solved itです。だから、ここで解決策をリンクしているので、他の人も答えを見つけることができます。

関連する問題