|
楼主 |
发表于 2004-9-20 14:05:55
|
显示全部楼层
版主大大我会增加信号,我是说如果在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();
} |
|