- NasalFileDialog::init("gui._FileDialog")
- .member("title", &FGFileDialog::getTitle, &FGFileDialog::setTitle)
- .member("button", &FGFileDialog::getButton, &FGFileDialog::setButton)
- .member("directory", &FGFileDialog::getDirectory, &FGFileDialog::setDirectory)
- .member("show_hidden", &FGFileDialog::showHidden, &FGFileDialog::setShowHidden)
- .member("placeholder", &FGFileDialog::getPlaceholder, &FGFileDialog::setPlaceholderName)
- .member("pattern", &FGFileDialog::filterPatterns, &FGFileDialog::setFilterPatterns)
- .method("open", &FGFileDialog::exec)
- .method("close", &FGFileDialog::close)
- .method("setCallback", &FGFileDialog::setCallbackFromNasal);
-
+ if (!NasalFileDialog::isInit()) {
+ NasalFileDialog::init("gui._FileDialog")
+ .member("title", &FGFileDialog::getTitle, &FGFileDialog::setTitle)
+ .member("button", &FGFileDialog::getButton, &FGFileDialog::setButton)
+ .member("directory", &FGFileDialog::getDirectory, &FGFileDialog::setDirectory)
+ .member("show_hidden", &FGFileDialog::showHidden, &FGFileDialog::setShowHidden)
+ .member("placeholder", &FGFileDialog::getPlaceholder, &FGFileDialog::setPlaceholderName)
+ .member("pattern", &FGFileDialog::filterPatterns, &FGFileDialog::setFilterPatterns)
+ .method("open", &FGFileDialog::exec)
+ .method("close", &FGFileDialog::close)
+ .method("setCallback", &FGFileDialog::setCallbackFromNasal);
+ }
+