Skip to content

Commit

Permalink
Added a fix to always find a local library folder on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Willoughby committed May 6, 2014
1 parent c4e508e commit 5aa56b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/tkd/tkdapplication.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module tkd.tkdapplication;
/**
* Private imports.
*/
import std.file : chdir, thisExePath;
import std.path : dirName;
import std.regex : match;
import std.string;
import tkd.interpreter;
Expand Down Expand Up @@ -76,6 +78,16 @@ abstract class TkdApplication
*/
public this()
{
// On Windows the Tcl/Tk library folder might be included in the
// executable's directory to make the entire application self-contained
// (using a local library and Tcl/Tk DLL's). So always set the current
// working directory to that of the executable's. Tcl/Tk should then
// always find it if it's there.
version (Windows)
{
thisExePath().dirName().chdir();
}

this._tk = Tk.getInstance();

// Fix to remove hard-coded background colors from widgets.
Expand Down

0 comments on commit 5aa56b1

Please sign in to comment.