2
내가 패널 애플릿을 만들려고 해요,하지만 난 첫 번째 단계에 붙어있어 : 을 나는 공식 예제 코드와 file.cpp을 만든 http://developer.gnome.org/panel-applet/3.0/getting-started.example.html그놈 대체 애플릿 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)
에서
는
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
을
무엇이 잘못 되었나요 ??