nomad-software / tkd Goto Github PK
View Code? Open in Web Editor NEWGUI toolkit for the D programming language based on Tcl/Tk
License: MIT License
GUI toolkit for the D programming language based on Tcl/Tk
License: MIT License
In this code:
catch (Throwable ex)
{
string error = "Error occurred in command callback. ";
error ~= ex.msg ~ "\n";
error ~= "Element: " ~ args.element.id ~ "\n";
Tcl_SetResult(tclInterpreter, error.toStringz, TCL_STATIC);
return TCL_ERROR;
}
Instead of catching Exception
, it catches Throwable
, making erroneous states that cannot logically be recovered from impossible. If the program throws an Error
it will continue, even if this Error
was caused by memory corruption or other such unrecoverable errata. It should instead catch Exception
which is reserved for errors that are safe to catch and handle (and therefore continue or recover from.)
From this thread : http://forum.dlang.org/post/[email protected]
"lflags":[-L/exet:nt/su:windows]
is needed to be added to the dub.json to prevent the console window from appearing.
Test if adding a parent to a window alters behaviour especially regarding stacking. For example if a dialog box is raised does it always stay above the main window?
Hello!
I decided to try tkd and noticed these things (compiled with ldc2 in linux). Cheers.
If you click file type filter or directory path button in a dialog clicking the button again won't close the popup and you have to click one of the texts to close it.
This one widget goes out of bounds to down/right when moved.
Building with GDC 4.9 on Arch x64 fails. The example segfaults of building in debug mode, and it gives OutOfMemory if built with release.
Hello there,
I'm looking for a software allowing the creation of Tk GUI returning XML Or UI format. Should I use Gtk instead of Tk ? On Tcl/Tk I read it could be possible to perform it by using Glade, is it ?
Thank to community.
In the example application entering a menu shortcut, e.g. Alt-F
issues an error.
The message is:
grab failed: window not viewable
grab failed: window not viewable
while executing
"grab -global $w"
(procedure "tk::TraverseToMenu" line 20)
invoked from within
"tk::TraverseToMenu .frame-F4FBE983.labelframe-3920BD3D.text-49FBE756 f"
(command bound to event)
Happens on ubuntu with dmd.
Regards,
Karl
I posted this issue on dlang forum first but since nobody seems to have an answer I created an issue here.
I want to rebind <Control-a>
to select all text in the Entry
widget, it doesn't work
private void selectText(CommandArgs args) {
this._clientId.selectText;
}
this._loginFrame = new Frame(2, ReliefStyle.groove);
this._clientId = new Entry(this._loginFrame).grid(1, 0);
this._clientId.bind("<Control-a>", &selectText);
It works if I change <Control-a>
to <Control-o>
for example.
Implement the geometry methods (pack, grid and place) fully.
does canvas use the gpu to draw?
if not can this be a added feature?
I would love to make a game and editor using the library and having to manager two graphics libraries are a pain.
auto editor = new Text();
editor.appendText("{");
outputs In text widget:
\{
Possible solution:
Use the following for the escaper:
string escape(string arg)
{
string replacer(Captures!(string) m)
{
final switch(m.hit)
{
case `\`: return `\\`;
case `"`: return `\"`;
case `$`: return `\$`;
case `[`: return `\[`;
case `]`: return `\]`;
}
assert(false);
}
return arg.replaceAll!(replacer)(regex(`\\|"|\$|\[|\]`));
}
And insert the text using:
this._tk.eval(`%s insert end "%s"`, this.id, text);
I get this error even if I add .setKeyboardFocus(KeyboardFocus.normal) to buttons
invalid command name "tk_focusNext"
Looks these are wrong on your repo readme:
"postGenerateCommands-windows-x86": [
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\tcl86.dll build\\tcl86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\tk86.dll build\\tk86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\zlib1.dll build\\zlib1.dll /y",
"xcopy $TCLTK_PACKAGE_DIR\\dist\\library build\\library /i /e /y",
],
"postGenerateCommands-windows-x86_64": [
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\tcl86.dll build\\tcl86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\tk86.dll build\\tk86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\zlib1.dll build\\zlib1.dll /y",
"xcopy $TCLTK_PACKAGE_DIR\\dist\\library build\\library /i /e /y",
],
should be tcl86t.dll, tk86t.dll, and zlib is not present
Style and ElementClass enums need finishing.
This is really a pain, as often these dialogs start at the home directory which is full of hidden files and directories in Linux.
There is a workaround for this unlucky default setup of file dialogs. Please see [(http://wiki.tcl.tk/1060)] when the discussion reaches June 2011: 'Is there a way to disable displaying of hidden directories in Linux (starting with a dot ".") when file sector dialog opens?'.
So I would like to put the following workaround for tkd into discussion. (I am new in D-programming, so there might well be a smarter approach.)
Background: As this workaround allocates resources (a dummy call to tk_getOpenFile is needed), it should be executed only once and only if the application uses DirectoryDialog, OpenFileDialog or SaveFileDialog.
Dialog
:/**
* Workaround to fix default of file dialogs showing unwanted
* hidden files and directories on Posix systems.
*
* To be called from constructor of FileDialog and of DirectoryDialog
* when on version(Posix).
*/
protected final void fixFileOrDirDialog() {
static bool fixed;
if (!fixed) {
fixed = true;
this._tk.eval("catch {tk_getOpenFile foo bar}"); // Dummy that instanciates below variables.
this._tk.eval("set ::tk::dialog::file::showHiddenVar 0"); // Don't show hidden entities.
this._tk.eval("set ::tk::dialog::file::showHiddenBtn 1"); // Show switch for hiddent entities.
}
}
FileDialog
(line 57ff) as follows:this(Window parent, string title)
{
this._typeVariable = format("variable-%s", this.generateHash("%s%s", this._elementId, this.id));
super(parent, title);
version(Posix) fixFileOrDirDialog();
}
DirectoryDialog
(54ff) as follows:this(Window parent, string title = "Directory")
{
super(parent, title);
version(Posix) fixFileOrDirDialog();
}
Sorry, but I could not find a solution where to touch only one spot in the code while holding the background condition mentioned above.
Regards,
Karl
It doesn't appear that there is any way to delete individual rows from a TreeView barring deleting them all with deleteRows(). Calling destroy() on TreeViewRow does nothing. I thought then maybe I could do it the incredibly inefficient way and get all rows, delete them all from the tree, build a new list of rows (checking manually as to not add ones I want to remove), then adding that new list back. The thing is, I can't even do that because there's no way to get the list of all rows! Is the functionality really that incomplete, or am I missing something here?
during startup it crashes with:
Running ./build/example/example
2015-02-07 09:49:16.950 example[6204:41647] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /SourceCache/AppKit/AppKit-1344.72/AppKit.subproj/NSBitmapImageRep.m:1288
2015-02-07 09:49:16.952 example[6204:41647] An uncaught exception was raised
2015-02-07 09:49:16.952 example[6204:41647] Invalid parameter not satisfying: cgImage != NULL
2015-02-07 09:49:16.952 example[6204:41647] (
0 CoreFoundation 0x00007fff9408366c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff95b6676e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9408344a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff8e85b3a9 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 AppKit 0x00007fff91783c13 -[NSBitmapImageRep initWithCGImage:] + 135
5 Tk 0x000000010ae5126c TkPutImage + 1767
6 Tk 0x000000010ae511d6 TkPutImage + 1617
7 Tk 0x000000010ae59040 TkMacOSXClearMenubarActive + 3222
8 Tk 0x000000010addfb48 TkSetWindowMenuBar + 5715
9 Tk 0x000000010addf64b TkSetWindowMenuBar + 4438
10 Tk 0x000000010ade0ce5 TkSetWindowMenuBar + 10224
11 Tk 0x000000010ade025d TkSetWindowMenuBar + 7528
12 Tcl 0x000000010acbe2b5 Tcl_ListMathFuncs + 1896
13 Tcl 0x000000010acbf3e6 Tcl_EvalEx + 1801
14 Tcl 0x000000010acbecf7 Tcl_EvalEx + 26
15 example 0x000000010a8442d7 D3tkd11interpreter3tcl3Tcl33__T4evalTAyaTAyaTAyaTAyaTAyaTAyaZ4evalMFAyaAyaAyaAyaAyaAyaAyaZv + 455
16 example 0x000000010a877591 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 233
17 example 0x000000010a7e28e2 D4main11Application10createMenuMFZv + 258
18 example 0x000000010a7e781f D4main11Application13initInterfaceMFZv + 583
19 example 0x000000010a8463a8 D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x000000010a7e7ed5 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010a7df2b0 _Dmain + 40
22 example 0x000000010a8945a4 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x000000010a8944e9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x000000010a894549 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x000000010a8944e9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x000000010a894465 _d_run_main + 433
27 example 0x000000010a7df31a main + 34
28 libdyld.dylib 0x00007fff8ccaa5c9 start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
2015-02-07 09:49:16.953 example[6204:41647] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9408366c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff95b6676e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9408344a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff8e85b3a9 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 AppKit 0x00007fff91783c13 -[NSBitmapImageRep initWithCGImage:] + 135
5 Tk 0x000000010ae5126c TkPutImage + 1767
6 Tk 0x000000010ae511d6 TkPutImage + 1617
7 Tk 0x000000010ae59040 TkMacOSXClearMenubarActive + 3222
8 Tk 0x000000010addfb48 TkSetWindowMenuBar + 5715
9 Tk 0x000000010addf64b TkSetWindowMenuBar + 4438
10 Tk 0x000000010ade0ce5 TkSetWindowMenuBar + 10224
11 Tk 0x000000010ade025d TkSetWindowMenuBar + 7528
12 Tcl 0x000000010acbe2b5 Tcl_ListMathFuncs + 1896
13 Tcl 0x000000010acbf3e6 Tcl_EvalEx + 1801
14 Tcl 0x000000010acbecf7 Tcl_EvalEx + 26
15 example 0x000000010a8442d7 D3tkd11interpreter3tcl3Tcl33__T4evalTAyaTAyaTAyaTAyaTAyaTAyaZ4evalMFAyaAyaAyaAyaAyaAyaAyaZv + 455
16 example 0x000000010a877591 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 233
17 example 0x000000010a7e28e2 D4main11Application10createMenuMFZv + 258
18 example 0x000000010a7e781f D4main11Application13initInterfaceMFZv + 583
19 example 0x000000010a8463a8 D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x000000010a7e7ed5 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010a7df2b0 _Dmain + 40
22 example 0x000000010a8945a4 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x000000010a8944e9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x000000010a894549 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x000000010a8944e9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x000000010a894465 _d_run_main + 433
27 example 0x000000010a7df31a main + 34
28 libdyld.dylib 0x00007fff8ccaa5c9 start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Error executing command run: Program exited with code -6
When I try to build the example, it fails with:
"Undefined symbols for architecture x86_64:
"_Tcl_MainEx", referenced from:
_Tcl_Main in tkd.o"
Any ideas?
You may want to fix the typos at package.json
(in README.me) when building for Windows (preGenerateCommands...
), currently copies the same .dll.
Possible fix, you can copy paste the following:
"postGenerateCommands-windows-x86": [
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\tcl86.dll build\\tcl86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\tk86.dll build\\tk86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86\\zlib1.dll build\\zlib1.dll /y",
"xcopy $TCLTK_PACKAGE_DIR\\dist\\library build\\library /i /e /y",
],
"postGenerateCommands-windows-x86_64": [
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\tcl86.dll build\\tcl86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\tk86.dll build\\tk86.dll /y",
"copy $TCLTK_PACKAGE_DIR\\dist\\x86_64\\zlib1.dll build\\zlib1.dll /y",
"xcopy $TCLTK_PACKAGE_DIR\\dist\\library build\\library /i /e /y",
],
I'm getting these errors:
source/tkd/widget/canvas.d(970): Warning: calling std.typecons.Nullable!int.Nullable.this without side effects discards return value of type Nullable!int, prepend a cast(void) if intentional
source/tkd/widget/canvas.d(1120): Warning: calling std.typecons.Nullable!int.Nullable.this without side effects discards return value of type Nullable!int, prepend a cast(void) if intentional
source/tkd/widget/canvas.d(1240): Warning: calling std.typecons.Nullable!int.Nullable.this without side effects discards return value of type Nullable!int, prepend a cast(void) if intentional
source/tkd/widget/canvas.d(1315): Warning: calling std.typecons.Nullable!int.Nullable.this without side effects discards return value of type Nullable!int, prepend a cast(void) if intentional
source/tkd/widget/canvas.d(1391): Warning: calling std.typecons.Nullable!int.Nullable.this without side effects discards return value of type Nullable!int, prepend a cast(void) if intentional
I've had a look through the code and I honestly can't understand why it's saying this.
Hi there, I would like to ask if MDI is supported by the library?
If so, how can that be implemented? Is it using window.window?
One more is getting the width property of a Treeview object. I always get width=1. I am trying to position a window next to a treeview by getting the width property but I am having a problem. I attached a screenshot of the main window. I want a new dialog or window to appear next to the treeview so I took the width of the treeview using getWidth and then passed it to the window to be created using the setGeometry method but I always get 1 as the width.
The code for the project is available at Github
Help would be much appreciated. Thank you!
Multiple assertion failures. The terminal output looks really obfuscated, so I have no idea how to begin.
Home$ dub --config=example
Fetching tcltk 8.6.5 (getting selected version)...
Placing tcltk 8.6.5 to /Users/Home/.dub/packages/...
Fetching x11 1.0.13 (getting selected version)...
Placing x11 1.0.13 to /Users/Home/.dub/packages/...
Building x11 1.0.13 configuration "tcltk-import", build type debug.
Running dmd...
Building tcltk 8.6.5 configuration "library", build type debug.
Running dmd...
Building tkd ~master configuration "example", build type debug.
Compiling using dmd...
Linking...
Running ./build/example/example
2016-03-14 16:15:25.515 example[57378:443596] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit- 1404.34/AppKit.subproj/NSBitmapImageRep.m:1289
2016-03-14 16:15:25.536 example[57378:443596] An uncaught exception was raised
2016-03-14 16:15:25.537 example[57378:443596] Invalid parameter not satisfying: cgImage != NULL
2016-03-14 16:15:25.537 example[57378:443596] (
0 CoreFoundation 0x00007fff91be0ae2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff86bee73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff91be08ba +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff887d688c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff9104385f -[NSBitmapImageRep initWithCGImage:] + 149
5 Tk 0x000000010bc615f4 TkPutImage + 1750
6 Tk 0x000000010bc6155e TkPutImage + 1600
7 Tk 0x000000010bc693f5 TkMacOSXClearMenubarActive + 3046
8 Tk 0x000000010bbf1a11 TkSetWindowMenuBar + 10987
9 Tk 0x000000010bbf0d00 TkSetWindowMenuBar + 7642
10 Tk 0x000000010bbf0e53 TkSetWindowMenuBar + 7981
11 Tk 0x000000010bbf0320 TkSetWindowMenuBar + 5114
12 Tcl 0x000000010bad645a Tcl_ListMathFuncs + 1981
13 Tcl 0x000000010bad7633 Tcl_EvalEx + 1941
14 Tcl 0x000000010bad6eb8 Tcl_EvalEx + 26
15 example 0x000000010b655727 D3tkd11interpreter3tcl3Tcl9__T4evalZ4evalMFNbAyaZv + 147
16 example 0x000000010b6ab480 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 412
17 example 0x000000010b62dc83 D4main11Application10createMenuMFZv + 1111
18 example 0x000000010b632abc D4main11Application13initInterfaceMFZv + 616
19 example 0x000000010b65801b D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 71
20 example 0x000000010b633169 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010b629478 _Dmain + 40
22 example 0x000000010b6ca718 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x000000010b6ca65d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x000000010b6ca6bd D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x000000010b6ca65d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x000000010b6ca5d3 _d_run_main + 499
27 example 0x000000010b629542 main + 34
28 libdyld.dylib 0x00007fff8b5e35ad start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
2016-03-14 16:15:25.537 example[57378:443596] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff91be0ae2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff86bee73c objc_exception_throw + 48
2 CoreFoundation 0x00007fff91be08ba +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff887d688c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff9104385f -[NSBitmapImageRep initWithCGImage:] + 149
5 Tk 0x000000010bc615f4 TkPutImage + 1750
6 Tk 0x000000010bc6155e TkPutImage + 1600
7 Tk 0x000000010bc693f5 TkMacOSXClearMenubarActive + 3046
8 Tk 0x000000010bbf1a11 TkSetWindowMenuBar + 10987
9 Tk 0x000000010bbf0d00 TkSetWindowMenuBar + 7642
10 Tk 0x000000010bbf0e53 TkSetWindowMenuBar + 7981
11 Tk 0x000000010bbf0320 TkSetWindowMenuBar + 5114
12 Tcl 0x000000010bad645a Tcl_ListMathFuncs + 1981
13 Tcl 0x000000010bad7633 Tcl_EvalEx + 1941
14 Tcl 0x000000010bad6eb8 Tcl_EvalEx + 26
15 example 0x000000010b655727 D3tkd11interpreter3tcl3Tcl9__T4evalZ4evalMFNbAyaZv + 147
16 example 0x000000010b6ab480 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 412
17 example 0x000000010b62dc83 D4main11Application10createMenuMFZv + 1111
18 example 0x000000010b632abc D4main11Application13initInterfaceMFZv + 616
19 example 0x000000010b65801b D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 71
20 example 0x000000010b633169 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010b629478 _Dmain + 40
22 example 0x000000010b6ca718 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x000000010b6ca65d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x000000010b6ca6bd D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x000000010b6ca65d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x000000010b6ca5d3 _d_run_main + 499
27 example 0x000000010b629542 main + 34
28 libdyld.dylib 0x00007fff8b5e35ad start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Error executing command run:
Program exited with code -6
Color methods have been added to widgets that can't use them.
For example, the color mixin has been added to the Entry
widget but calling setBackgroundColor
doesn't change anything while setForegrounfColor
does.
Either find a way to make these work or remove them from widgets where there is not support possibly breaking the mixin up to be more focused.
I was assuming this was like an onChange event for the text element, and it works that way for the first input change. But for subsequent changes no event occurs. Is there a flag that needs to be reset?
$ dub --config=example
Performing "debug" build using dmd for x86_64.
x11 1.0.9: building configuration "library"...
tcltk 8.6.5: building configuration "library"...
tkd ~master: building configuration "example"...
Linking...
Running ./build/example/example
2015-12-20 16:47:32.272 example[14499:450785] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1404.34/AppKit.subproj/NSBitmapImageRep.m:1289
2015-12-20 16:47:32.276 example[14499:450785] An uncaught exception was raised
2015-12-20 16:47:32.276 example[14499:450785] Invalid parameter not satisfying: cgImage != NULL
2015-12-20 16:47:32.276 example[14499:450785] (
0 CoreFoundation 0x00007fff92b53ae2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff85b6ff7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff92b538ba +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff904c988c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff8c78685f -[NSBitmapImageRep initWithCGImage:] + 149
5 Tk 0x00000001052a35f4 TkPutImage + 1750
6 Tk 0x00000001052a355e TkPutImage + 1600
7 Tk 0x00000001052ab3f5 TkMacOSXClearMenubarActive + 3046
8 Tk 0x0000000105233a11 TkSetWindowMenuBar + 10987
9 Tk 0x0000000105232d00 TkSetWindowMenuBar + 7642
10 Tk 0x0000000105232e53 TkSetWindowMenuBar + 7981
11 Tk 0x0000000105232320 TkSetWindowMenuBar + 5114
12 Tcl 0x000000010511345a Tcl_ListMathFuncs + 1981
13 Tcl 0x0000000105114633 Tcl_EvalEx + 1941
14 Tcl 0x0000000105113eb8 Tcl_EvalEx + 26
15 example 0x0000000104c887af D3tkd11interpreter3tcl3Tcl9__T4evalZ4evalMFNbAyaZv + 147
16 example 0x0000000104ce2698 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 412
17 example 0x0000000104c63ed3 D4main11Application10createMenuMFZv + 1111
18 example 0x0000000104c68d0c D4main11Application13initInterfaceMFZv + 616
19 example 0x0000000104c8b56c D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x0000000104c693b9 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x0000000104c5f6e8 _Dmain + 40
22 example 0x0000000104d01718 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x0000000104d0165d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x0000000104d016bd D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x0000000104d0165d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x0000000104d015d3 _d_run_main + 499
27 example 0x0000000104c5f7b2 main + 34
28 libdyld.dylib 0x00007fff8c1f05ad start + 1
)
2015-12-20 16:47:32.277 example[14499:450785] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff92b53ae2 __exceptionPreprocess + 178
1 libobjc.A.dylib 0x00007fff85b6ff7e objc_exception_throw + 48
2 CoreFoundation 0x00007fff92b538ba +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff904c988c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 AppKit 0x00007fff8c78685f -[NSBitmapImageRep initWithCGImage:] + 149
5 Tk 0x00000001052a35f4 TkPutImage + 1750
6 Tk 0x00000001052a355e TkPutImage + 1600
7 Tk 0x00000001052ab3f5 TkMacOSXClearMenubarActive + 3046
8 Tk 0x0000000105233a11 TkSetWindowMenuBar + 10987
9 Tk 0x0000000105232d00 TkSetWindowMenuBar + 7642
10 Tk 0x0000000105232e53 TkSetWindowMenuBar + 7981
11 Tk 0x0000000105232320 TkSetWindowMenuBar + 5114
12 Tcl 0x000000010511345a Tcl_ListMathFuncs + 1981
13 Tcl 0x0000000105114633 Tcl_EvalEx + 1941
14 Tcl 0x0000000105113eb8 Tcl_EvalEx + 26
15 example 0x0000000104c887af D3tkd11interpreter3tcl3Tcl9__T4evalZ4evalMFNbAyaZv + 147
16 example 0x0000000104ce2698 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 412
17 example 0x0000000104c63ed3 D4main11Application10createMenuMFZv + 1111
18 example 0x0000000104c68d0c D4main11Application13initInterfaceMFZv + 616
19 example 0x0000000104c8b56c D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x0000000104c693b9 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x0000000104c5f6e8 _Dmain + 40
22 example 0x0000000104d01718 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 40
23 example 0x0000000104d0165d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
24 example 0x0000000104d016bd D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv + 45
25 example 0x0000000104d0165d D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 45
26 example 0x0000000104d015d3 _d_run_main + 499
27 example 0x0000000104c5f7b2 main + 34
28 libdyld.dylib 0x00007fff8c1f05ad start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Program exited with code -6
ComboBox.setData(["c:\a\b"]) //Garbage
It works if you double escape the backslashes but makes it difficult and error prone to use.
ComboBox.setData(["c:\a\b"])
The build is successful but when I attempt to run it, two error prompts happen. Both have the same message tcl86t.dll
is not found. I checked my dub folder in "Appdata/Roaming", and it is found under the dist folder, just fine.
I had no tcl installation so I went to install Activetcl 8.6, but that dll is not there, and it doesn't run. I downloaded the dll from the internet and placed it in the same folder, and only one error prompts occured.
Is there a special build link that I should include if I'm using it from Windows?
Hi,
I'm the d-apt maintainer. I noticed that when running the example, the open file and Directory dialogs do not properly show the file/folder names if they include some accent or another diacritical mark. Is TkD dialogs non compatible with UTF-8?
Here attach you some captures from Debian.
Regards,
Jordi
How to install this in Windows ?
Compile Tcl/Tk as DLLs for distribution for Windows platforms. If this is done then the end user does not need Tcl/Tk installed on their machine.
tkd\dialog\dialog.d(22): Error: class tkd.dialog.dialog.Dialog unable to resolve forward reference in definition
The same is for DirectoryDialog, FontDialog, FileDialog, OpenFileDialog, SaveFileDialog, MessageDialog.
I'm building with DMD 2.064.2.
On a fresh Windows 10 system, the following files need to be installed, or programs will exit with uninformative error codes:
https://www.microsoft.com/en-us/download/details.aspx?id=30679
https://www.microsoft.com/en-us/download/details.aspx?id=52685
This is often not an issue since many windows programs need these and the end-user is likely to already have them installed. Since no information is provided by the program when they aren't included, it should be noted in the README that these will need to be installed.
Instead of loading text widget images from disk, convert them to data and embed in the application for distribution.
Correctly implement commands for buttons. Current the only way to get a button to do something is to bind an event. While this works it's not disabled if the button is disabled like a true button command.
I was wondering if it is possible to change widget's background color like from Python's Tkinter:
<widget>.configure(backgrounf="red")
Thanks
I havent got much experience with D yet but I got these undefined references - the library should be properly included. https://pastebin.com/neWNdVN3
What am I doing wrong?
Is it possible to create an OpenGL context inside of a TkD window? Potentially with something like Derelict?
Here's a log of the commands to build/run the example (just dub --config=example)
[dymk@Codeinator tkd]» dub --config=example
The following changes will be performed:
Fetch x11 >=1.0.0, userWide
Fetch tcltk >=8.6.2, userWide
Fetching x11 1.0.0...
Placing x11 1.0.0 to /Users/dymk/.dub/packages/...
Fetching tcltk 8.6.2...
Placing tcltk 8.6.2 to /Users/dymk/.dub/packages/...
x11: ["x11"]
tcltk: ["tcltk", "x11"]
tkd: ["tkd", "tcltk", "x11"]
Building x11 configuration "tcltk-import", build type debug.
Running dmd...
Building tcltk configuration "library", build type debug.
Running dmd...
Building tkd configuration "example", build type debug.
Compiling...
Linking...
Running ./example
2014-05-08 07:43:59.111 example[1512:507] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /SourceCache/AppKit/AppKit-1265.19/AppKit.subproj/NSBitmapImageRep.m:1286
2014-05-08 07:43:59.128 example[1512:507] An uncaught exception was raised
2014-05-08 07:43:59.129 example[1512:507] Invalid parameter not satisfying: cgImage != NULL
2014-05-08 07:43:59.130 example[1512:507] (
0 CoreFoundation 0x00007fff90af125c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff91951e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff90af1038 +[NSException raise:format:arguments:] + 104
3 Foundation 0x00007fff8f37ed41 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
4 AppKit 0x00007fff8cdb6367 -[NSBitmapImageRep initWithCGImage:] + 135
5 Tk 0x000000010274dcea TkPutImage + 1733
6 Tk 0x000000010274dc49 TkPutImage + 1572
7 Tk 0x0000000102755922 TkMacOSXClearMenubarActive + 3065
8 Tk 0x00000001026defad TkSetWindowMenuBar + 5819
9 Tk 0x00000001026deab7 TkSetWindowMenuBar + 4549
10 Tk 0x00000001026e00eb TkSetWindowMenuBar + 10233
11 Tk 0x00000001026df82c TkSetWindowMenuBar + 7994
12 Tcl 0x00000001025cbab6 Tcl_ListMathFuncs + 1503
13 Tcl 0x00000001025ccd9d Tcl_EvalEx + 1838
14 Tcl 0x00000001025cc689 Tcl_EvalEx + 26
15 example 0x00000001021ce442 D3tkd11interpreter3tcl3Tcl33__T4evalTAyaTAyaTAyaTAyaTAyaTAyaZ4evalMFAyaAyaAyaAyaAyaAyaAyaZv + 230
16 example 0x0000000102202c25 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 233
17 example 0x0000000102181296 D4main11Application10createMenuMFZv + 258
18 example 0x00000001021861ea D4main11Application13initInterfaceMFZv + 222
19 example 0x00000001021cfcd4 D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x0000000102186779 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010217ebd8 _Dmain + 40
22 example 0x000000010221e6b9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi6runAllMFZv9__lambda1MFZv + 33
23 example 0x000000010221e605 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv + 45
24 example 0x000000010221e665 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi6runAllMFZv + 45
25 example 0x000000010221e605 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv + 45
26 example 0x000000010221e581 _d_run_main + 449
27 example 0x000000010217ec32 main + 34
28 libdyld.dylib 0x00007fff8d8bb5fd start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
2014-05-08 07:43:59.131 example[1512:507] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff90af125c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff91951e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff90af1038 +[NSException raise:format:arguments:] + 104
3 Foundation 0x00007fff8f37ed41 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
4 AppKit 0x00007fff8cdb6367 -[NSBitmapImageRep initWithCGImage:] + 135
5 Tk 0x000000010274dcea TkPutImage + 1733
6 Tk 0x000000010274dc49 TkPutImage + 1572
7 Tk 0x0000000102755922 TkMacOSXClearMenubarActive + 3065
8 Tk 0x00000001026defad TkSetWindowMenuBar + 5819
9 Tk 0x00000001026deab7 TkSetWindowMenuBar + 4549
10 Tk 0x00000001026e00eb TkSetWindowMenuBar + 10233
11 Tk 0x00000001026df82c TkSetWindowMenuBar + 7994
12 Tcl 0x00000001025cbab6 Tcl_ListMathFuncs + 1503
13 Tcl 0x00000001025ccd9d Tcl_EvalEx + 1838
14 Tcl 0x00000001025cc689 Tcl_EvalEx + 26
15 example 0x00000001021ce442 D3tkd11interpreter3tcl3Tcl33__T4evalTAyaTAyaTAyaTAyaTAyaTAyaZ4evalMFAyaAyaAyaAyaAyaAyaAyaZv + 230
16 example 0x0000000102202c25 D3tkd6widget4menu4menu4Menu41__T8addEntryTC3tkd6widget4menu4menu4MenuZ8addEntryMFC3tkd5image5image5ImageAyaDFS3tkd7element7element11CommandArgsZvAyaAyaZC3tkd6widget4menu4menu4Menu + 233
17 example 0x0000000102181296 D4main11Application10createMenuMFZv + 258
18 example 0x00000001021861ea D4main11Application13initInterfaceMFZv + 222
19 example 0x00000001021cfcd4 D3tkd14tkdapplication14TkdApplication6__ctorMFZC3tkd14tkdapplication14TkdApplication + 48
20 example 0x0000000102186779 D4main11Application6__ctorMFZC4main11Application + 21
21 example 0x000000010217ebd8 _Dmain + 40
22 example 0x000000010221e6b9 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi6runAllMFZv9__lambda1MFZv + 33
23 example 0x000000010221e605 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv + 45
24 example 0x000000010221e665 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi6runAllMFZv + 45
25 example 0x000000010221e605 D2rt6dmain211_d_run_mainUiPPaPUAAaZiZi7tryExecMFMDFZvZv + 45
26 example 0x000000010221e581 _d_run_main + 449
27 example 0x000000010217ec32 main + 34
28 libdyld.dylib 0x00007fff8d8bb5fd start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Error executing command run: Program exited with code -6
OS: Windows 10
Arch: x64
tkd: 1.1.13
tcl86t.dll: Retrieved from nomad-software/tcltk/dist/x86_64/
tk86t.dll: Retrieved from nomad-software/tcltk/dist/x86_64/
The following code produces a segmentation fault iff one chooses a file in the dialog using its "Open" button. Closing the dialog by clicking the "Cancel" button or closing its window will not trigger anything untoward.
auto ofd = new OpenFileDialog("Open file")
.show();
Below is the output from gdb.
Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000068f51ef8 in tk86t!TkGetCursorByName () from path/to/project/tk86t.dll
Hopefully the referenced function will give you an idea, because I haven't been able to do much with it.
I've also tried using 8.6.>6 binaries, but then, while the OpenFileDialog doesn't produce issues, merely exiting the application will precipitate a segmentation fault. I have no idea if you can do anything, but I'm at a loss.
Kind regards,
Dan
Currently when attaching a scrollbar to a widget or vice-versa the actual communication between them is delegated directly through to Tcl/Tk. It would be nice to have these implemented in D so they can be overridden. This would be handy if you want to create custom widgets purely in D.
Because the garbage collector cleans up during runtime it may free uniqueData
and callback
inside the CommandArgs
struct when creating a new command. Check and alter the behaviour of the Element.createCommand
method to not allow this.
https://github.com/nomad-software/tkd/blob/master/source/tkd/element/element.d#L172
Hi there,
i am completely new in D Programming and only want to start the example code for TK that is described HERE on the homepage.
For this i have gitcloned the 3 packages tcltk tkd x11 in the folder /usr/local/GIT/.
Then i run the command dub inside any single folder and build it.
When i want to run the example TK D script the following results are seen -
$ dmd -I/usr/local/GIT/ hw_graphical2.d
hw_graphical2.d(1): Error: module tkdapplication is in file 'tkd/tkdapplication.d' which cannot be read
import path[0] = /usr/local/GIT/
import path[1] = /usr/include/dmd/phobos
import path[2] = /usr/include/dmd/druntime/import
hans@mx1:~/Documents/D_lang
$
I have made something wrong with the configuration of the TKD module.
Need help here to start programming with D and TK.
WBR
MHE
I had to update to phobos head for some reasons and now I'm getting these errors:
externals\tkd\build\tkd.lib(uni)
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList11addIntervalMFNaNeiikZk
externals\tkd\build\tkd.lib(uni)
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList8dropUpToMFNaNekkZk
externals\tkd\build\tkd.lib(uni)
Error 42: Symbol Undefined _D3std3uni38__T13InversionListTS3std3uni8GcPolicyZ13InversionList8skipUpToMFNaNekkZk
I'm not sure where you may be using std.uni, this library is quite big O_o
Investigate a way to clean up image and textvariable data from the interpreter. e.g. When image objects are created they create an image in the interpreter. When the image object falls out of scope and is collected, the image is still in the interpreter. Fix this if poss.
Update ddoc template to create better indexes for documentation. Currently the index is too long and runs off the page.
I keep getting this error
program.d(1): Error: module `tkdapplication` is in file 'tkd\tkdapplication.d' which cannot be read
when doing this..
module pure_editor.main;
import tkd.tkdapplication;
void main()
{
auto app = new Application(); // Create the application.
app.run();
}
class Application : TkdApplication
{
override protected void initInterface() // Initialise user interface.
{
auto frame = new Frame(2, ReliefStyle.groove) // Create a frame.
.pack(10); // Place the frame.
auto label = new Label(frame, "Hello World!") // Create a label.
.pack(10); // Place the label.
auto exitButton = new Button(frame, "Exit") // Create a button.
.setCommand(&this.exitCommand) // Use the callback.
.pack(10); // Place the button.
}
private void exitCommand(CommandArgs args) // Create a callback.
{
this.exit(); // Exit the application.
}
}
I have installed dub and am using vs code right now with this extension https://marketplace.visualstudio.com/items?itemName=webfreak.code-d
A few of the controls have their background colors set incorrectly by default (presumably using a hard-coded white instead of the proper system color for control backgrounds). Aside from not looking good, this can also result in invisible text:
http://semitwist.com/download/img/shots/tkd1.png
http://semitwist.com/download/img/shots/tkd2.png
Not sure if this is just Windows or if it's happening on other platforms too.
Sorry, I do not want to misuse the "Issues" section. But it would
be a nice extension if it were possible to have a modern OpenGL
accelerated widget. Maybe throwing in some Tcl3D (http://www.tcl3d.org)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.