An XOTcl question

Liste des GroupesRevenir à cl tcl 
Sujet : An XOTcl question
De : hgiese (at) *nospam* ratiosoft.com (Helmut Giese)
Groupes : comp.lang.tcl
Date : 26. Jun 2024, 23:17:41
Autres entêtes
Organisation : ratiosoft
Message-ID : <493p7j5mt662no7u9pe6f8e4729jrr7a5n@4ax.com>
User-Agent : Forte Free Agent 1.93/32.576 English (American)
Hello out there,
I am reviving an old project of mine from around  2008 / 2010 because
I thought I could use some of its parts.  The XOTcl version used then
was 1.4 IIRC. The current version is 2.3 which I think is fairly
recent.
My grief is the error message produced when something goes wrong
constructing a new object: The exact reason is - so it seems - never
told - let alone the offending location. This makes it extremely
tedious to advance.
Look at the following example. Context: Having set a particular 'mode'
I click at some place where I want a new line to start. The code:
---
# ctor - coords are <x, y, starting widget>
Line instproc init {canvas coordLst {cName ""}} {
    my instvar c cfg coords id

    # call base class ctor
    lassign $coordLst x y widgets
    next $canvas [list $x $y] ;#$cfg  ;#$options

    set coords {} ; set widgets {}
puts lb
    # create first point
    my newLinePoint $x $y
puts lc
    bindC $c $id <Enter> {s::mkLargePointCurs $c}
}

# Create a new point
Line instproc newLinePoint {x y} {
    my instvar c children coords
    set x [$c canvasx $x] ; set y [$c canvasy $y]
    lappend children [LinePoint [LinePoint autoname Point%d] $c [list
$x $y] \
                      -parent [self]]
    lappend coords $x $y
}
----
I want to create a line starting with a 1st point.
This is the result:
---
Microsoft Windows [Version 10.0.19045.4529]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

d:\x\Test>tclsh main.tcl
lb

and an error window.
---
My conclusions:
- I see 'lb' but not 'lc' - my conclusion is: The error must be in
'newLinePoint'.
- But this is the error message:
--
wrong # args: should be "next canvas coordinates ?mainDict?"
wrong # args: should be "next canvas coordinates ?mainDict?"
    ::Line ::xotcl::Class->create
    invoked from within
"::Line create Line1 .mainFr.c {72 66 ::LEDBtn1} -parent ::C"
    ("uplevel" body line 1)
    invoked from within
"::uplevel $lvl [list [self] create {*}$args]"
    (procedure "unknown" line 7)
    ::Line ::xotcl::Class->unknown
    invoked from within
"Line Line$lineNo $c [list $x $y $state] -parent [self]"
    (procedure "startCreateLine" line 10)
    ::C ::Canvas->startCreateLine
    invoked from within
"my startCreateLine $state $x $y $line"
...
---
What is this? The call to 'next' has well been passed when it puts out
the 'lb', and in 'newLinePoint' I don't call 'next'.

Questions:
- Has anybody a strategy to cope with this behaviour?
- Or is there a newer version which produces usable error messages?
- I have read that there is a successor to XOTcl.
  -- Does it have this same deficiency?
  -- If not: Is it somehow upwards compatible with XOTcl?

Oh, this is on Windows 10, 64 bit under tcl 8.6.10.
Any help or idea will be greatly appreciated.
Helmut
PS: Sorry for the long rant.

Date Sujet#  Auteur
26 Jun 24 * An XOTcl question3Helmut Giese
10 Jul 24 `* Re: An XOTcl question2Stefan Sobernig
11 Jul 24  `- Re: An XOTcl question1Helmut Giese

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal