#2326 original widget namespace??

obsolete: 8.5b1
closed-invalid
5
2007-10-31
2007-09-27
Don Porter
No

% namespace origin button
::button
% namespace origin tk::button
::tk::button

I would have expect one of these
commands to be a [namespace import]
of the other. What am I missing?

Discussion

  • Don Porter

    Don Porter - 2007-10-31
    • assigned_to: hobbs --> jenglish
     
  • Don Porter

    Don Porter - 2007-10-31

    Logged In: YES
    user_id=80530
    Originator: YES

    jenglish, can you offer any answer
    here?

     
  • Joe English

    Joe English - 2007-10-31

    Logged In: YES
    user_id=68433
    Originator: NO

    > can you offer any answer here?

    Dunno.

    generic/tkWindow.c, ~lines 140-160 registers all the core widget constructor commands in the global namespace, and lines 160-180 register them again in the ::tk:: namespace. Change introduced 2006-10-30 Jeff Hobbs, changelog says "add Ttk_Init call, copy tk classic widgets to ::tk namespace."

    Why would you expect one to be a [namespace import] of the other, and does it make a difference?

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-31

    Logged In: YES
    user_id=72656
    Originator: NO

    Why did you have the expectation of being linked by namespaces? I preferred the C-level copy as it could possibly avoid some weird edge cases, like getting C level command info and such.

     
  • Don Porter

    Don Porter - 2007-10-31
    • assigned_to: jenglish --> dgp
    • status: open --> closed-invalid
     
  • Don Porter

    Don Porter - 2007-10-31

    Logged In: YES
    user_id=80530
    Originator: YES

    ah, command info is a good point.

    I was imagining a vision for
    Tk's long-term future as just another
    conventional (TEA) package, and to
    me that includes defining all commands
    in a namespace derived from the package
    name. In that future, [tk::button] would
    be a Tk command, and scripts wanting to
    use it as [::button] would [namespace import]
    it for themselves. I was initially surprised
    we couldn't just get to that endpoint
    immediately.

    The command info matter is a good reason not
    to make that leap until Tk 9, though, I agree.
    Closing this as Invalid.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-31

    Logged In: YES
    user_id=72656
    Originator: NO

    One last comment as I wasn't exactly clear - the command info is a real current concern, because it is used today in the core Tk code for some things that should probably be done a different way, but currently aren't. :-|

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks