|
还是glade的使用.我知道这很初级,但是念在我第一次学......真的不懂啊.....:neutral:
问题,怎么在诸如interface.c,intarface.h,main.c,main.h,callback.c,callback.h,support.c,support.h等glade自动生成的src文件中加入代码,使之生成一个只含有myprogram.c,myprogram.h的文件呢???
我现在有这样一段代码.就是不知道如何加进去.......
[code:1]
#include <gnome.h>
gint eventDelete(GtkWidget *widget,
GdkEvent *event,gpointer data);
gint eventDestroy(GtkWidget *widget,
GdkEvent *event,gpointer data);
static GtkWidget *makeWidget();
int main(int argc,char *argv[])
{
GtkWidget *app;
GtkWidget *widget;
gnome_init("gnomefileentry","1.0",argc,argv);
app = gnome_app_new("gnomefileentry","GnomeFileEntry");
gtk_container_set_border_width(GTK_CONTAINER(app),20);
gtk_signal_connect(GTK_OBJECT(app),"delete_event",
GTK_SIGNAL_FUNC(eventDelete),NULL);
gtk_signal_connect(GTK_OBJECT(app),"destroy",
GTK_SIGNAL_FUNC(eventDestroy),NULL);
widget = makeWidget();
gnome_app_set_contents(GNOME_APP(app),widget);
gtk_widget_show_all(app);
gtk_main();
exit(0);
}
gint eventDelete(GtkWidget *widget,
GdkEvent *event,gpointer data) {
return(FALSE);
}
gint eventDestroy(GtkWidget *widget,
GdkEvent *event,gpointer data) {
gtk_main_quit();
return(0);
}
static GtkWidget *makeWidget()
{
GtkWidget *fileentry;
fileentry = gnome_file_entry_new("fseekid","File Seeking");
return(fileentry);
}
[/code:1]
真的没办法了....... |
|