2024-07-18
| ||
14:24 | [3300362]: document already merged changs check-in: b5abf2d9c6 user: oehhar tags: trunk | |
2024-05-24
| ||
16:30 | • Closed ticket [3300362fff]: Tooltip font, msgcat namespace plus 8 other changes artifact: 8ebb7e4813 user: oehhar | |
16:25 | Ticket [3300362]: add arguments to the msgcat call by options -msgargs and -infoargs check-in: c97cae5b0c user: oehhar tags: tooltip-plus-image-and-info | |
16:11 | • Ticket [3300362fff] Tooltip font, msgcat namespace status still Open with 4 other changes artifact: 100f6e7968 user: oehhar | |
16:08 | Ticket [3300362]: record the caller namespace for msgcat resolution. Add a namespace option to override. Some other option bugs fixed check-in: b145a5c24f user: oehhar tags: tooltip-plus-image-and-info | |
2024-05-05
| ||
13:24 | • Ticket [3300362fff] Tooltip font, msgcat namespace status still Open with 3 other changes artifact: 1b3757f0b7 user: aku | |
13:24 | • Ticket [3300362fff]: 6 changes artifact: 330d12db0b user: aku | |
2011-05-11
| ||
08:44 | • New ticket [3300362fff]. artifact: f49da238b9 user: oehhar | |
Ticket UUID: | 3300362 | |||
Title: | Tooltip font, msgcat namespace | |||
Type: | RFE | Version: | None | |
Submitter: | oehhar | Created on: | 2011-05-11 08:44:16 | |
Subsystem: | tklib :: tooltip | Assigned To: | aku | |
Priority: | 3 Low | Severity: | Minor | |
Status: | Closed | Last Modified: | 2024-05-24 16:30:19 | |
Resolution: | Fixed | Closed By: | oehhar | |
Closed on: | 2024-05-24 16:30:19 | |||
Description: |
Leaving BWidget, I was looking to the tktooltip package. Here are two comments: 1) Tooltip font Currently, the default font for labels is used as tooltip font. This might not be the desired font. Since Tk8.5, there is the special font "TkTooltipFont" containing the current tooltip font which might be used. Possible code from BWidget: if {$::tcl_version >= 8.5} { set fontdefault TkTooltipFont } elseif {$Widget::_aqua} { set fontdefault {helvetica 11} } else { set fontdefault {helvetica 8} } label -font $fontdefault 2) msgcat namespace IMHO, the use of msgcat within tooltips is half baken: - the namespace where msgcat::mc is called should be the namespace of the caller and not ::tooltip - there are no parameters allowed to" msgcat::mc" Suggestion: - save the caller namespace on tooltip creation for a later msgcat call - add a "--" option to the arguments to stop argument parsing - Allow to have multiple arguments after the message key. Save it as list and pass it to msgcat as arguments. Possible msgcat call with namespace and arguments namespace eval $ns [concat ::msgcat::mc $lkey] I would volonter to submit a patch for the two issues if this sounds reasonable - Harald | |||
User Comments: |
oehhar added on 2024-05-24 16:30:19:
Commit [c97cae5b0c] addds the options *-msgargs* and *-infoargs*. The ticket proposal was not taken to eventually allow later to not require "" around the message or other extensions. Anyway, there were two of them needed, one for msg, one for -info. Here is a demonstrator script: package require tooltip msgcat::mcset "de" testMsg "This is not shown" namespace eval test { pack [ttk::entry .e] msgcat::mcset "de" testMsg "Message with two variables: %s, %s" msgcat::mcset "de" testInfo "Info with two variables: %s, %s" ::tooltip::tooltip .e -msgargs {"Var 1" "Var 2" "Var 3"} testMsg } namespace eval test2 { pack [ttk::entry .e2] ::tooltip::tooltip .e2 -namespace ::test\ -msgargs {"Var 1" "Var 2" "Var 3"}\ -infoargs {"Info 1" "Info 2" "Info 3"}\ -info testInfo\ testMsg } I am running out of time today and may resume in one week. The info part does not fill the whole box showing a yellow triangle in the corner. Anyway, I would prefer yellow background instead of the grey as BWidget ;-). Thanks for all. Ticket closed. Take care, Harald oehhar added on 2024-05-24 16:11:29: With commit [b145a5c24f], the namespace handling is handled for msgcat. Here is a test script: package require tooltip msgcat::mcset "de" testMsg "This is an outer test message" namespace eval test { pack [ttk::entry .e] msgcat::mcset "de" testMsg "This is a test message" ::tooltip::tooltip .e testMsg } namespace eval test2 { pack [ttk::entry .e2] ::tooltip::tooltip .e2 -namespace ::test testMsg } Without the patch, the outer message is shhown. Now, the message within the namespace is shown. |