[Tutor] Creating menu shortcut key bindings

dn PythonList at DancesWithMice.info
Thu Jun 1 18:14:08 EDT 2023


On 02/06/2023 09.23, Alan Gauld via Tutor wrote:
> On 01/06/2023 12:35, David wrote:
> 
>> Your event sequence does not specify any event type [2].
>>
>> Some event sequences allow the event type to be omitted
>> for brevity. For example [3]:
>>    'x' is the same as '<KeyPress-x>'
>>
>> However, I suspect that what you have might not be recognised.
>> Looking at working code I have here (without actually
>> testing what you have) I see that I have:
>>    '<Control-KeyPress-o>'
> 
> I have code that binds <Control-space> and it works OK.
> I suspect the widget might be the issue. But its all speculation
> without knowing how the GUI builder constructs things.

Disclaimer: My bias is to use HTML5 for multi-platform GUI.


One of the short-comings in the Python world has been the lack of a 
GUI-generator. The major GUI-libraries are all programmer-oriented, ie 
building things-up by creating individual widgets fitted into wider 
constructs.

Whereas other systems are more user-oriented and probably start with the 
appearance of the visual interface rather than 'what this button does' 
("declarative" cf "procedural").

Considering the meaning of the "U" in "GUI", and the importance of UX 
(User Experience), the latter makes a lot of sense, and from a 
designer's PoV, makes it a lot easier to involve the user - and on the 
machine in 'dynamic mode' rather than on-paper or a white-board. (see 
also Agile approaches)

Hence the OP piquing my interest!

As programmers, the former suits the way we usually work (and think).

The 'holy grail' of such generators is 'round-tripping': the ability to 
generate a GUI's code from some layout, PLUS to take existing code and 
use it within the generator. This enables one to operate in either/both 
mode(s).

Unfortunately, judging from web-questions associated with this package, 
it appears to be less than reliable as a generator and has no ability to 
work from existing tk-code.

-- 
Regards,
=dn


More information about the Tutor mailing list