Dprogramming.com - The D Programming Language [archived content]

Entice Designer
DCode editor
    D irclib IRC
    ini files
    list linked list
    Splat sockets

DFL 0.9.8

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.

"Thanks for allowing me to be in the world of Windows. I hated Windows programming until DFL." -- User

"DFL is very easy to use once you see how it works. It's even similar to Windows Forms of .NET. So I think of D+DFL as a good alternative to C#+.NET. Also, DFL has Entice Designer which makes it even easier." -- User

With DFL you can:

  • Create and manage your GUI application with a simple, object-oriented interface.
  • Attach event handlers to many objects, such as controls, forms, and menus, for practically any event.
  • Dock controls on the parent form, so resize code isn't needed.
  • Use sockets that do not block the GUI thread.
  • Much more!

What's New

New: DFL Tutorial

DFL now works with D1, D2 and Tango!

Entice Designer also released; a new version of the GUI builder.

As before, there's always new conversations happening over in the DFL forum.

Final Update: DFL will no longer be maintained by dprogramming.com Please see the GUI Libraries wiki page for DFL forks.

A new DFL snapshot is available (RC4)

Download DFL 0.9.8 installer for an older version of DMD
or DFL 0.9.8 zip archive
Tested with DMD v1.030 and DMD v1.036.
Tested with Tango 0.99.7 with DMD v1.033.

Be sure to read the DFL tutorial for setup and usage instructions. The included examples are a good starting point.

The download includes:

  • The DFL library that can be used with closed source and commercial applications.
  • dfl.exe tool that should simplify compiling DFL projects.
  • Source code for DFL and many examples.

Should work on Microsoft Windows 95 and above. However, on Windows 95, some features require an up to date version of Internet Explorer to be installed. There are functions to call to test for these features.

New DFL Users

New to DFL? Need to get started? First, check out the DFL tutorial, which also includes setup and usage instructions.
The installer will give you start menu shortcuts, one of which takes you to the Examples Folder. The provided DFL examples show how to use a lot of the features, as they are used to test the library between releases.
The online documentation can be used to find the available members. The documentation is far from complete, but can be edited by those who wish to contribute.

Entice Designer, a Form Designer for DFL, is also helpful to newcomers because the properties are easily accessible in a convenient list including descriptions. Entice also has a tutorial available.

Also new to the D language? Check out the "New D Users" section on the dprogramming.com home page.

Example Code

Classic hello world example:
import dfl.all;

int main()
   Form myForm;
   Label myLabel;
   myForm = new Form;
   myForm.text = "DFL Example";
   myLabel = new Label;
   myLabel.font = new Font("Verdana", 14f);
   myLabel.text = "Hello, DFL World!";
   myLabel.location = Point(15, 15);
   myLabel.autoSize = true;
   myLabel.parent = myForm;
   return 0;
Hello, DFL World!

There are many more examples in the DFL download. More screenshots are here.


Q. What changed since the last version of DFL? / How do I ensure my code is still compatible with DFL?
A. See the changelog for a list of library changes.
Q. I need help, how can I get support?
A. The DFL forum is the primary medium for support. There is also the contact form, and freenode #DFL
Q. Is there a tutorial?
A. Yes, there is a DFL Tutorial.
Q. Does DFL work with the Tango library?
A. DFL does support the Tango library now! See the DFL Tango page for more information.
Either Phobos (std) or Tango can be used as you prefer.
Q. Is Unicode supported?
A. Yes! On Windows NT/2000/XP/2003/Vista, Unicode is fully supported; on Windows 95/98/ME, DFL translates to and from ANSI as necessary to support Unicode (much like MSLU and Phobos).
The Unicode translation appropriate for the Windows version is automatic and both Windows types are supported simultaneously. To override this, such as to build an exe for only NT+, versions can be set.
Q. Will there be a linux version?
A. Porting has begun! (Posted May 2007)
Q. I've added an event handler using the delegate keyword or a nested function and I'm getting access violations. Why is this?
A. Delegate literals and nested functions only work if you're sure the event won't be fired after the function it's in returns. Use a non-static member function:
class MyForm: Form
      click ~= &form_click;   // Add click event handler.
   private void form_click(Object sender, EventArgs ea)
      // Handle event here.
Q. How do I safely load regular text files or other 8-bit text into a DFL control?
A. Because DFL (and most of D) expects clean UTF-8, this can be a problem when working with external text. This is covered on the load 8-bit text page.
Q. Where can I find more example code and screenshots?
A. There is a lot of example code in the DFL download, also see ExampleCode and DFL tutorials.
Find more screenshots here.


DFL forum hosted by dsource.org!

Check out the new Entice Designer project! A GUI Builder for DFL.

DFL Wiki.

The start of new documentation is available here. It doesn't explain much yet, but it's often easier than going through the code, and you're welcome to add directly to it.


Please report bugs and comments to the forum or the contact form. You can make requests and I'll see what I can do to get them in the next release.

See the snapshots for changes in the next DFL release.

Previous DFL versions:

Copyright © 2004-2008 Christopher E. Miller