digitalmars.D.learn - How to rebind the default tkd GUI keybinds?
- tastyminerals (15/15) Oct 11 2020 Tk default keys are somewhat different from what we used to use
- tastyminerals (3/18) Oct 17 2020 So, this is even tricky in Python TkInter but possible.
- starcanopy (6/30) Oct 17 2020 You could try directly calling
- tastyminerals (3/17) Nov 25 2020 So, there is a way. It just needs substantial time investment :)
Tk default keys are somewhat different from what we used to use for selecting, copying and pasting the text. So, any Tk based GUI app starts with writing the rebinding function for "ctrl+a", "ctrl+c", "ctrl+x" and "ctrl+v" keys, at least. I did it when writing TkInter based apps in Python. Today I am trying out tkd and want to do the same. However, it doesn't work :( For example: private void selectText(CommandArgs args) { this._clientId.selectText; } this._loginFrame = new Frame(2, ReliefStyle.groove); this._clientId = new Entry(loginFrame).grid(1, 0); this._clientId.bind("<Control-a>", &selectText); It works if I change "<Control-a>" to "<Control-o>" for example. But how do I overwrite the actual "<Control-a>" key in tkd?
Oct 11 2020
On Sunday, 11 October 2020 at 18:51:17 UTC, tastyminerals wrote:Tk default keys are somewhat different from what we used to use for selecting, copying and pasting the text. So, any Tk based GUI app starts with writing the rebinding function for "ctrl+a", "ctrl+c", "ctrl+x" and "ctrl+v" keys, at least. I did it when writing TkInter based apps in Python. Today I am trying out tkd and want to do the same. However, it doesn't work :( For example: private void selectText(CommandArgs args) { this._clientId.selectText; } this._loginFrame = new Frame(2, ReliefStyle.groove); this._clientId = new Entry(loginFrame).grid(1, 0); this._clientId.bind("<Control-a>", &selectText); It works if I change "<Control-a>" to "<Control-o>" for example. But how do I overwrite the actual "<Control-a>" key in tkd?So, this is even tricky in Python TkInter but possible. In tkd this is not possible unfortunately.
Oct 17 2020
On Saturday, 17 October 2020 at 09:33:04 UTC, tastyminerals wrote:On Sunday, 11 October 2020 at 18:51:17 UTC, tastyminerals wrote:You could try directly calling [bindtags](https://www.tcl.tk/man/tcl8.4/TkCmd/bindtags.htm) with _tk.eval. Modifying and extending tkd is easy from my experience where I had added support for additional image formats. (After blundering about on how to get tcl/tk to work, lol.)Tk default keys are somewhat different from what we used to use for selecting, copying and pasting the text. So, any Tk based GUI app starts with writing the rebinding function for "ctrl+a", "ctrl+c", "ctrl+x" and "ctrl+v" keys, at least. I did it when writing TkInter based apps in Python. Today I am trying out tkd and want to do the same. However, it doesn't work :( For example: private void selectText(CommandArgs args) { this._clientId.selectText; } this._loginFrame = new Frame(2, ReliefStyle.groove); this._clientId = new Entry(loginFrame).grid(1, 0); this._clientId.bind("<Control-a>", &selectText); It works if I change "<Control-a>" to "<Control-o>" for example. But how do I overwrite the actual "<Control-a>" key in tkd?So, this is even tricky in Python TkInter but possible. In tkd this is not possible unfortunately.
Oct 17 2020
On Saturday, 17 October 2020 at 18:39:54 UTC, starcanopy wrote:On Saturday, 17 October 2020 at 09:33:04 UTC, tastyminerals wrote:So, there is a way. It just needs substantial time investment :) Thanks for point it out.On Sunday, 11 October 2020 at 18:51:17 UTC, tastyminerals wrote:You could try directly calling [bindtags](https://www.tcl.tk/man/tcl8.4/TkCmd/bindtags.htm) with _tk.eval. Modifying and extending tkd is easy from my experience where I had added support for additional image formats. (After blundering about on how to get tcl/tk to work, lol.)[...]So, this is even tricky in Python TkInter but possible. In tkd this is not possible unfortunately.
Nov 25 2020