Ticket UUID: | 6e85abae9e49281b3b1212e25082f73239f7ea9e | |||
Title: | tooltip msgcat error, if tooltip is created within a method | |||
Type: | Bug | Version: | main | |
Submitter: | oehhar | Created on: | 2024-07-14 13:42:02 | |
Subsystem: | tklib :: tooltip | Assigned To: | aku | |
Priority: | 5 Medium | Severity: | Minor | |
Status: | Open | Last Modified: | 2024-07-18 14:59:36 | |
Resolution: | None | Closed By: | nobody | |
Closed on: | ||||
Description: |
Here is the relevant ticket on TCL: https://core.tcl-lang.org/tcl/tktview/91b3a5bb14e6e8ae1d1c5349af12e08879ea152d. The solution might be (also) here. Actually, tooltip saves the caller namespace to later call msgcat. This does not work if called from an oo context. There are the following solutions:
I personally would favor for solution 3. BWidget did it like that. The additional computation burden on showing the tooltip is perhaps also not beautiful. Thanks for all, Harald | |||
User Comments: |
oehhar added on 2024-07-18 14:59:36:
A proposed implementation for solution 3 is now in branch [ticket-6e85abae9e-msgcat-removed] starting with commit [d57268cc82]. Is it a good idea to merge this? Thank you and take care, Harald oehhar added on 2024-07-17 17:20:47: Comment by Ashok on the core list: I see the content displayed in widgets as falling into two categories. To take the example of a dialog, - Buttons like "Ok", "Cancel" fall into the dialog widget's domain assuming they are not configurable by application. The widget code should then look up these in message catalog using its own namespace. - The text, tooltips, labels etc. which are all under the application control should be displayed *as passed*. The content is owned by the application and it is the application's responsibility to look them up in the message catalog before passing to the widget. So in the case of the tooltip, I would argue it is the wrong design to msgcat::mc the tooltip in the first place. It should be up to the application itself to pass locale-dependent text. As a practical matter, when widgets get wrapped through widget adapters a la Snit, I am not sure if you could deduce the namespace at all. /Ashok |
