|
发表于 2005-8-22 09:09:56
|
显示全部楼层
GtkWidget *file_choose_dialog;
char *filename;
file_choose_dialog = gtk_file_chooser_dialog_new ("Open File",
GTK_WINDOW(user_data),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
if (gtk_dialog_run (GTK_DIALOG (file_choose_dialog)) == GTK_RESPONSE_ACCEPT)
{
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_choose_dialog));
g_print ("Select file : %s\n",g_filename_to_utf8 (filename,-1,0,0,0));
gtk_widget_destroy (file_choose_dialog);
} |
|