|
楼主 |
发表于 2005-8-16 09:18:03
|
显示全部楼层
#ifdef fdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gnome.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include <unistd.h>
void OpenNessus(GtkWidget * button,gpointer data)
{
execl("/bin/bash","/bin/sh","/root/project/nessus",NULL);
}
GtkWidget * AddButton(GtkWidget * box,const gchar * buttonText)
{
GtkWidget * button;
button=gtk_button_new_with_label(buttonText);
gtk_box_pack_start(GTK_BOX(box),button,FALSE,TRUE,0);
gtk_widget_show(button);
}
void
on_scan_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget * window1;
GtkWidget * box;
window1=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window1),320,200);
gtk_window_set_title(GTK_WINDOW(window1),"Scan Tool List");
gtk_container_border_width(GTK_CONTAINER(window1),5);
box=gtk_hbox_new(TRUE,5);
button=AddButton(box,"Nessus");
gtk_signal_connect(GTK_OBJECT(button),
"clicked",
GTK_SIGNAL_FUNC(OpenNessus),
NULL);
gtk_container_add(GTK_CONTAINER(window1),box);
gtk_widget_show(box);
gtk_widget_show(window1);
}
我把跟这部分功能相关的函数帖出来了,大家帮我看看,我检查了两天也不知道哪错了,麻烦大家了 |
|