本文整理汇总了C++中FrameView::containingWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameView::containingWindow方法的具体用法?C++ FrameView::containingWindow怎么用?C++ FrameView::containingWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameView
的用法示例。
在下文中一共展示了FrameView::containingWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openFileChooser
void FileChooser::openFileChooser(Document* document)
{
FrameView* view = document->view();
if (!view)
return;
GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"),
GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view->containingWindow()))),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
// We need this protector because otherwise we can be deleted if the file upload control is detached while
// we're within the gtk_run_dialog call.
RefPtr<FileChooser> protector(this);
String result;
const bool acceptedDialog = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT;
if (acceptedDialog && stringByAdoptingFileSystemRepresentation(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), result))
chooseFile(result);
gtk_widget_destroy(dialog);
}