[tcltk-perl] RE: $widget->exists
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-04-26 08:06:17
|
> The following change: > > * lib/Tcl/Tk.pm: perlTk compatibility: sub PathName, > Exists, class, toplevel, parent, *all* winfo methods. > > broke our app, because we used $bwtree->exists($path) to access the > ".tree exists path" subcommand of BWTree. After this change this > method call was routed to winfo instead. I fixed it in our sources be > removing the winfo override for exists. I suggest we make that > official too. There is already Tcl::Tk::Exists() for doing 'winfo > exists' checks. Let it be like you said! Will you insert this change by yourself? > > Anyway, this illustrates that we need a better mechanism to deal with > conflicts like this. There should be a way for force method calls to > resolve a particular way. Firstly, you can always define specific method for any widget and no AUTOLOAD will mix with it. Secondly, situation was worse recently, when all non-trivial widgets created methods in Tcl::Tk::Widget package and therefore could mix with each other easily. Also, there exists a TODO comment in AUTOLOAD and there is an explanation about restricting method names in Widget autoloading mechanism Personally to me, I very like current situation where exists such a mechanism when you can work in perlTk way even with new widgets. like in http://www.perlmonks.org/index.pl?node_id=346153 Best regards, Vadim. |