'How to access a Tcl package option in tkinter?

I was reading about msgcat's package options.

How do I get, set and update these values?

I tried these:

root.eval("::msgcat::mcfolder")    # _tkinter.TclError: invalid command name "::msgcat::mcfolder"
root.globalgetvar("::msgcat::mcfolder")    # _tkinter.TclError: can't read "::msgcat::mcfolder": no such variable
root.option_get("mcfolder", "msgcat")    # ''

where root is a tkinter.Tk instance.

I am not finding any info about this in Tcl docs either or I didn't look closely.



Solution 1:[1]

Ok so it turns out that this isn't a Tcl-wide concept, but just something msgcat does, so:

root.eval("::msgcat::mcpackageconfig get mcfolder")

works when mcload is already called or mcfolder is set.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 demberto