|
楼主 |
发表于 2006-6-15 17:32:03
|
显示全部楼层
嘎嘎,终于整通了!
void
on_SendFile_clicked (GtkButton *button,
gpointer user_data)/*主窗口中按钮的回调*/
{
GtkWidget *about;
about = create_filechooserdialog1();
/*注册欲在about窗口构件的回调函数中引用的主窗口中的控件到about构件*/
g_object_set_data (GTK_OBJECT (about), "windows1_label19",
lookup_widget (GTK_WIDGET (button), "label19"));
gtk_widget_show(about);
}
void
on_SeleFileBtn_clicked (GtkButton *button,
gpointer user_data)/*一个对话框中按钮的回调*/
{
/*put the select file to windows1*/
GtkWidget *windows1_label19;
windows1_label19 = g_object_get_data (
GTK_OBJECT (gtk_widget_get_toplevel(GTK_WIDGET(button))),
"windows1_label19"); /*通过注册的字符串取出主窗口中的构件指针*/
g_assert(windows1_label19);
gtk_label_set_text(GTK_LABEL(windows1_label19),"Select a file!");/*可以引用的*/
gtk_widget_destroy(gtk_widget_get_toplevel(GTK_WIDGET(button)));
} |
|