[Incrtcl-develop] [ incrtcl-Bugs-2837655 ] Namespace import fails to properly create class commands
by SourceForge.net other posts by this author
Aug 14 2009 7:01AM messages near this date
[Incrtcl-develop] [ incrtcl-Bugs-2840994 ] itk_component createCmds in wrong scope
|
[Incrtcl-develop] [ incrtcl-Bugs-2830946 ] info level 0 inside a method returns unexpected data
Bugs item #2837655, was opened at 2009-08-14 15:00
Message generated for change (Tracker Item Submitted) made by pwdraper
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=113244&aid=2837655&group_id=13244
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Namespace usage
Group: 4.0*
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter W. Draper (pwdraper)
Assigned to: Michael McLennan (mmclennan)
Summary: Namespace import fails to properly create class commands
Initial Comment:
Hi, if I import all the class commands from a namespace this causes an error
claiming that all the class commands already exists. Consider the script:
package require itcl
package require itk
namespace import itk::*
itcl::class Test {
inherit itk::Toplevel
constructor {args} {
puts "Construction: $this -> $args"
eval itk_initialize $args
}
destructor {
puts "Destruction: $this"
}
}
Test .t -title "New window"
When I run this against itcl-ng (with tcl8.6) I get the error:
Error in startup script: cannot inherit from "itk::Toplevel" (can't create object "itk::Topl
evel": command already exists with that nameITCL: cannot create Tcl_NewObjectInstance for cl
ass "::itk::Toplevel")
while executing
"inherit itk::Toplevel"
(class "Test" body line 3)
invoked from within
"itcl::class Test {
inherit itk::Toplevel
constructor {args} {
puts "Construction: $this -> $args"
eval itk_initialize $args
}
..."
(file "itest.tcl" line 6)
Removing the "namespace import" line fixes the problem or moving
back to itcl 3.4.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=113244&aid=2837655&group_id=13244
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Incrtcl-develop mailing list
Incrtcl-develop@[...].net
https://lists.sourceforge.net/lists/listinfo/incrtcl-develop
|