|
楼主 |
发表于 2004-9-20 14:59:22
|
显示全部楼层
大大们帮帮,那儿错了呜呜呜
版主大大我会增加信号,我是说如果在callback.c里再按纽信号里添加改变窗口位置的回调函数,我在gtk2.0里可以,添加到callback.c里就不行了.我想把改变窗口位置的函数添加到buton1里,但一直出错.应该怎样添加呢?
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include <gnome.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
gboolean
on_window1_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{gtk_main_quit();
return FALSE;
}
void
on_button1_clicked (GtkButton *button,
gpointer user_data)
{gtk_window_move(GTK_WINDOW(window1),0,0);
}
void
on_button2_clicked (GtkButton *button,
gpointer userdata)
{GtkWidget *dialog;
//创建带确认按钮的对话框,父控件为空
dialog = gtk_message_dialog_new(NULL,
GTK_DIALOG_MODAL |GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
(gchar*)"hello sagaeon");
gtk_dialog_run(GTK_DIALOG(dialog));//显示并运行对话框
gtk_widget_destroy(dialog);//销毁对话框
}
void
on_button3_clicked (GtkButton *button,
gpointer user_data)
{gtk_main_quit();
}
版主大大你看看我里面的这一段呀
void
on_button1_clicked (GtkButton *button,gpointer user_data)
{
gtk_window_move(GTK_WINDOW(window1),0,0);
} ,就是这个函数在gtk2.0里没问题,添加到glade2的callback.c里就不行了
在button1里加了改变窗口的那个函数make就通不行呀,为什么呀版主大大,如果你的话怎样写呀
[root@computer window]# make
make all-recursive
make[1]: Entering directory `/myfile/system/glade/window'
Making all in src
make[2]: Entering directory `/myfile/system/glade/window/src'
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DPACKAGE_DATA_DIR=\""/usr/local/share"\" -DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/X11R6/include -I/usr/include/freetype2/freetype2 -I/usr/include/libxml2 -g -O2 -c callbacks.c
callbacks.c: In function `on_button1_clicked':
callbacks.c:25: error: `window1' undeclared (first use in this function)
callbacks.c:25: error: (Each undeclared identifier is reported only once
callbacks.c:25: error: for each function it appears in.)
make[2]: *** [callbacks.o] 错误 1
make[2]: Leaving directory `/myfile/system/glade/window/src'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/myfile/system/glade/window'
make: *** [all-recursive-am] 错误 2
[root@computer window]# |
|