[archived content]
Dfl /

DFL Tutorial

DFL, the D Forms Library, is an easy to use user interface toolkit for the D programming language. It brings you a high level, easy to use interface, abstracted from the native API.

New Entice Designer and DFL video tutorials!

Getting Started with D

If you are already using D or already setup your D compiler, you can skip on to the next section. Otherwise, you need to dive into D and install a compiler. Below are your options. Click on the links for setup instructions and more information.

  • DMD - Digital Mars D Compiler
    • DMD with the Phobos standard library; this is the default and most common way to use DFL.
    • DMD with the Tango library; this requires a separate installation. More information can be found at DFL and Tango.

Getting Started with DFL

If you are already using DFL or already have it setup, you can skip on to the next section. Otherwise, go on over to the DFL page and download the DFL installer!

After going through the installer, you will have new start menu shortcuts, one of which points to many DFL examples.

Editors and IDEs

The Wiki for D has a page listing many Editors and IDEs supporting D.

Entice Designer is recommended for DFL users as it comes with a drag-and-drop GUI builder for DFL windows, and contains a rich code editor.

Compiling / Testing DFL

Compiling with DFL can be done several ways, some ways easier than others.

  • The simplest way to compile with DFL is to use the dfl.exe command. Simply open a command prompt, cd to the directory containing the source files you wish to compile, and type dfl sourcefile.d you can add -gui switch and any other source files to include in the compilation (for example, if the code you are compile is split across 2 files, you will need to include both file names).

  • Another way is to use rebuild or DSSS. Download and install, open a command prompt, cd to the directory containing the source files you wish to compile, and type rebuild sourcefile.d you can add the -gui and -version=gui switches; note that you do not need to enter any other source files to the command, it will figure it out.

  • Or you can use bud/build. Download and install, open a command prompt, cd to the directory containing the source files you wish to compile, and type bud sourcefile.d you can add -gui and -version=gui switches; note that you do not need to enter any other source files to the command, it will figure it out.

  • Finally, the least appealing choice is to call the compiler directly. You must follow strict rules when doing this or things may behave erratically and even crash. The details can be found on the old setup instructions page; look for the "use DMD directly" section.

Example Compiling with dfl.exe

Phobos users:

An example compiling using the dfl.exe command using Phobos is detailed below.

  • Click Start -> Programs -> DFL -> Examples Folder
  • Open a command prompt
  • cd to the Examples Folder:
    cd C:\dmd\packages\dfl\examples
  • Invoke the dfl.exe command on one of the DFL Examples. Most of the examples contain an example command at the top of the file. Type the command into the command prompt:
    dfl -gui helloworld.d
  • Assuming all things went well, it should have created an exe file. You can either double click on it or type its name into the command prompt:
    helloworld

Continue on to the next page; writing DFL code...

Page last modified on November 29, 2008, at 05:38 PM