 +	static void SendRefs(BMessage *m, bool changedir);
 +
 +	sem_id		fFilePanelSem;
-+	BFilePanel	fSavePanel;
-+	BFilePanel	fOpenPanel;
++	BFilePanel*	fFilePanel;
 +	BPath		fBrowsedPath;
 +	private:
 +};

+		char_u *initdir,
+		char_u *filter)
+{
+	BFilePanel& Panel = (saving == TRUE) ? 
+		gui.vimApp->fSavePanel : gui.vimApp->fOpenPanel;
+
+	gui.vimApp->fBrowsedPath.Unset();
+
+	Panel.Window()->SetTitle((char*)title);
+	//if(initdir != NULL)
+	Panel.SetPanelDirectory((const char*)initdir);
+
+	Panel.Show();
+
+	gui.vimApp->fFilePanelSem = create_sem(0, "FilePanelSem");
+
+	while(acquire_sem(gui.vimApp->fFilePanelSem) == B_INTERRUPTED);
+
+	status_t result = gui.vimApp->fBrowsedPath.InitCheck();
+	if(result == B_OK) {
+		return vim_strsave((char_u*)gui.vimApp->fBrowsedPath.Path());
+	} else
+		if(result != B_NO_INIT) {
+			fprintf(stderr, "gui_mch_browse: BPath error: %#08x (%s)\n", 
+					result, strerror(result));
+		}
+
+	return NULL;
+}
+#endif /* FEAT_BROWSE */
+

+VimApp::VimApp(const char *appsig):
+	BApplication(appsig),
+	fFilePanelSem(-1),
+	fFilePanel(NULL)
+{
+}
+
