Re: Tklib's tooltip poss bug in method although fine in a function

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Tklib's tooltip poss bug in method although fine in a function
De : undroidwish (at) *nospam* googlemail.com (undroidwish)
Groupes : comp.lang.tcl
Date : 15. Jul 2024, 05:22:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v7286q$i636$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
On 7/14/24 21:01, Harald Oehlmann wrote:
Am 14.07.2024 um 20:25 schrieb greg:
In msgcat.tcl (Tcl 9.0)
>
This means I no longer get the error message.
The namespace is being searched for at this point, and in my opinion self is not needed at all.
>
>
proc ::msgcat::PackageNamespaceGet {} {
     set ns [uplevel 2 { namespace current }]
>
     if {![string match {::oo::*} $ns]} {
         # Not in object environment
         return $ns
     }
>
     # Check if we are within an object
     if {[info object isa object $ns]} {
         return [info object namespace $ns]
     } elseif {[info object isa class $ns]} {
         return [info object namespace $ns]
     } elseif {[info object isa metaclass $ns]} {
         return [info object namespace $ns]
     } elseif {[info object isa mixin $ns]} {
         return [info object namespace $ns]
     } elseif {[info object isa typeof $ns]} {
         return [info object namespace $ns]
     } else {
         # Not in an object or class environment
         return $ns
     }
}
>
Gregor
>
 Thanks a lot, Gregor.
 Your proposed solution is now in a branch referenced in the ticket.
It would be great, if:
- there would be a test case for the issue
- the comment above the modification may be corrected. If I count the "if's" I get 7 cases and not 4.
...
Looks almost good, except that the tests for mixin and typeof
require more context (one additional parameter). Thus they must
be left out, i.e.
       ...
       # Check if we are within an object
       if {[info object isa object $ns]} {
           return [info object namespace $ns]
       } elseif {[info object isa class $ns]} {
           return [info object namespace $ns]
       } elseif {[info object isa metaclass $ns]} {
           return [info object namespace $ns]
       }
       # Not in an object or class environment
       return $ns
      ...
My 0.02 currency units,
Christian

Date Sujet#  Auteur
13 Jul 24 * Tklib's tooltip poss bug in method although fine in a function14Mark Summerfield
13 Jul 24 `* Re: Tklib's tooltip poss bug in method although fine in a function13greg
13 Jul 24  `* Re: Tklib's tooltip poss bug in method although fine in a function12undroidwish
13 Jul 24   +- Re: Tklib's tooltip poss bug in method although fine in a function1undroidwish
14 Jul 24   `* Re: Tklib's tooltip poss bug in method although fine in a function10Harald Oehlmann
14 Jul 24    +* Re: Tklib's tooltip poss bug in method although fine in a function4greg
14 Jul 24    i`* Re: Tklib's tooltip poss bug in method although fine in a function3Harald Oehlmann
15 Jul 24    i `* Re: Tklib's tooltip poss bug in method although fine in a function2undroidwish
15 Jul 24    i  `- Re: Tklib's tooltip poss bug in method although fine in a function1Harald Oehlmann
15 Jul 24    `* Re: Tklib's tooltip poss bug in method although fine in a function5Mark Summerfield
15 Jul 24     `* Re: Tklib's tooltip poss bug in method although fine in a function4Mark Summerfield
15 Jul 24      `* Re: Tklib's tooltip poss bug in method although fine in a function3Harald Oehlmann
15 Jul 24       `* Re: Tklib's tooltip poss bug in method although fine in a function2Mark Summerfield
15 Jul 24        `- Re: Tklib's tooltip poss bug in method although fine in a function1Harald Oehlmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal