dlangui/docs/all.html

59 lines
2.5 KiB
HTML

<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>dlangui.all</title>
</head><body>
<h1>dlangui.all</h1>
<!-- Generated by Ddoc from src/dlangui/all.d -->
DLANGUI library.
<br><br>
This module is just to simplify import of most useful DLANGUI modules.
<br><br>
<b>Synopsis:</b><br>
<pre class="d_code"><font color=green>// helloworld
</font><font color=blue>import</font> dlangui.<u>all</u>;
<font color=green>// required in one of modules
</font><font color=blue>mixin</font> APP_ENTRY_POINT;
<font color=green>/// entry point for dlangui based application
</font><font color=blue>extern</font> (C) <font color=blue>int</font> UIAppMain(string[] args) {
<font color=green>// resource directory search paths
</font> string[] resourceDirs = [
appendPath(exePath, <font color=red>"../../../res/"</font>), <font color=green>// for Visual D and DUB builds
</font> appendPath(exePath, <font color=red>"../../../../res/"</font>), <font color=green>// for Mono-D builds
</font> appendPath(exePath, <font color=red>"res/"</font>) <font color=green>// when res dir is located at the same directory as executable
</font> ];
<font color=green>// setup resource directories - will use only existing directories
</font> drawableCache.setResourcePaths(resourceDirs);
<font color=green>// setup i18n - look for i18n directory inside one of passed directories
</font> i18n.findTranslationsDir(resourceDirs);
<font color=green>// select translation file - for english language
</font> i18n.load(<font color=red>"en.ini"</font>); <font color=green>//"ru.ini", "en.ini"
</font>
<font color=green>// create window
</font> Window window = Platform.instance.createWindow(<font color=red>"My Window"</font>, <font color=blue>null</font>);
<font color=green>// create some widget to show in window
</font> window.mainWidget = (<font color=blue>new</font> Button()).text(<font color=red>"Hello world"d</font>);
<font color=green>// show window
</font> window.show();
<font color=green>// run message loop
</font> <font color=blue>return</font> Platform.instance.enterMessageLoop();
}
</pre>
<br><br>
<b>License:</b><br>
Boost License 1.0
<br><br>
<b>Authors:</b><br>
Vadim Lopatin, coolreader.org@gmail.com<br><br>
<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. Vadim Lopatin, 2014
</small>
</body></html>