 Window@ CreatePopup(Menu@ baseMenu)
 {
     Window@ popup = Window();
+    popup.vars["Popup"] = baseMenu.name;
     popup.style = uiStyle;
     popup.SetLayout(LM_VERTICAL, 1, IntRect(2, 6, 2, 6));
     baseMenu.popup = popup;

    Array<UIElement@> children = ui.root.GetChildren();
    for (uint i = 0; i < children.length; ++i)
    {
        if (children[i].type != textType)
            children[i].opacity = opacity;
    }
}

    uiFileSelector.path = initialPath;
    uiFileSelector.SetButtonTexts(ok, cancel);
    uiFileSelector.SetFilters(filters, initialFilter);
    uiFileSelector.window.vars["Popup"] = "FileSelector";

    CenterDialog(uiFileSelector.window);
}
