Closed dymk closed 10 years ago
There are a few things to check.
DMD is 2.065, dub is ~master, port reports tk as version tk @8.6.1_1+quartz
I don't get a crash, however, when commenting out lines 167 - 171 in example.d:
auto fileMenu = new Menu(menuBar, "File", 0)
.addEntry(new EmbeddedPng!("cancel.png"), "Quit", &this.exitApplication, ImagePosition.left, "Ctrl-Q");
auto helpMenu = new Menu(menuBar, "Help", 0)
.addEntry(new EmbeddedPng!("help.png"), "About...", &this.showAbout, ImagePosition.left, "F1");
It's probably the EmbeddedPng interacting strangely with the menu bar. No other image buttons show up with an image either, but rather only as a normal OSX buttons.
Even though you have Tcl/Tk 8.6 installed make sure that's the one that's being linked to the executable. Check the dependencies on the compiled exe by using otool
in the terminal. (you may need to install the xcode command line tools)
otool -L <executable>
http://tech-queries.blogspot.co.uk/2011/04/dynamic-library-dependency-on-mac-os-x.html
Oh good catch!
[dymk@Codeinator tkd]» otool -L build/example/example
build/example/example:
/System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.9)
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.9)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
I'll start fiddling around with getting OSX to use the ports version instead of the preinstalled one. If you know an easy way to do this, please let me know.
Closing this as it was due to linking against an unsupported version of Tcl/Tk.
Here's a log of the commands to build/run the example (just dub --config=example)