[tcltk-perl] Re: $widget->exists
Brought to you by:
hobbs
From: Gisle A. <gi...@Ac...> - 2004-04-26 08:46:39
|
"Konovalov, Vadim" <vko...@sp...> writes: > > 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? Done. > > 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. Makes it harder to document sensibly what happens. If the winfo methods were $widget->winfo_foo instead there would not be this problem. > 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 True. I would not loose that. My wish would be that there was a plain/easy to explain mapping from method calls to Tcl/Tk so that you can know which piece of documentation to look up. On top of this we mix in PerlTk methods that only become available when you request PerlTk compatiblity. For these methods we don't require consistency in naming or behaviour. --Gisle |