我正在学习Tkd,但在example我看到了如何从按钮调用方法(例如openDirectoryDialog
。但我想直接调用它。
import std.algorithm;
import std.array;
import std.datetime;
import std.file;
import tkd.tkdapplication;
class Application : TkdApplication
{
override protected void initInterface()
{
this.mainWindow.setTitle("Tkd Showcase");
}
void openDirectoryDialog(CommandArgs args)
{
auto dialog = new DirectoryDialog("Choose a directory")
.setDirectoryMustExist(true)
.show();
string x = dialog.getResult();
}
}
void main()
{
auto app = new Application();
app.run();
app.openDirectoryDialog; // here is my attemped
}
我做错了什么?在我收到错误: `错误:没有属性' openDirectoryDialog'对于类型' main.Application'