Questions tagged [incr-tcl]

[incr Tcl] is an object system package for the Tcl programming language.

[incr Tcl] (often abbreviated to “itcl” for ease of typing) is an object system for Tcl. It is usually used as an extension package — loaded with package require Itcl — and was originally developed for Tcl 7.* but which has been updated subsequently for the faster Tcl 8 system model. It provides a model of objects that is a hybrid between the command-focussed model of Tcl and the class model of (pre-template) C++. It is probably the most commonly used object system for Tcl, though many others exist.

Itcl also has the distinction of having inspired a number of features in the core Tcl language. These notably include namespaces and ensembles, as well as the TclOO object system that is present from Tcl 8.6 onwards. Note that a version of [incr Tcl] (4.0) is also supplied with Tcl 8.6 so as to make it far easier for existing code that depends on itcl, and that is built on top of the TclOO core.

25 questions
0
votes
1 answer

Is there a way to make [incr Tcl] classes friends?

Is there a way to obtain a friendship between classes in incr Tcl? Consider the code below. package require Itcl ::itcl::class A { private { proc f { } { puts "==== A::f" } } } ::itcl::class B { public { …
Vahagn
  • 4,670
  • 9
  • 43
  • 72
0
votes
1 answer

Can't hide constructor at [incr Tcl]

Consider the code below. package require Itcl ::itcl::class A \ { private { constructor { } { } { puts "==== at A::constructor" } method f { } { puts "==== at A::f" } } } A a ;# PASSES a f ;# fails For class A the constructor is…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
0
votes
1 answer

Access Itcl Class Scope in Tcl Thread

First of all, this is a follow up to a previous question of mine. I would like to use threading in Tcl but in collaboration with Itcl. Here is a sample: package require Itcl package require Thread ::itcl::class ThreadTest { variable thread…
elmt
  • 1,604
  • 14
  • 24
0
votes
1 answer

::itcl::delete throws error "invalid command name"

I am using itcl delete command to delete objects and classes. However, tcl interpreter says "invalid command name "delete". Here is the partial code snippet. % itcl::find classes datapath point datapath_point itcl::find objects datapath_point0…
boppu
  • 135
  • 2
  • 3
  • 9
0
votes
2 answers

Why -editable is not working in iwidgets (tcl/tk)?

I was trying to use iwidgets in some GUI and I want to make combobox non-editable. As per activetcl documentation, the -editable option is mentioned for combobox and yet it is not working. combobox $frm_sat1.c2 \ -textvariable [itcl::scope type]…
OliveOne
  • 238
  • 1
  • 6
  • 23
0
votes
1 answer

change the iwidgets::combobox selected value tcl/tk

How to change the iwidgets::combobox selected value in tcl/tk? variable check [iwidgets::combobox .check -labeltext "aaaa" -selectioncommand aaa_update] eval .check insert list 0 aaa bbb I tried the following and it doesn't work. (set…
0
votes
3 answers

Tcl: Setting a private variable of an owned instance within a class

Suppose the following code declarations: itcl::class ObjectA { private variable m_ownedObject private variable m_someVariable constructor {} \ { set m_ownedObject [ObjectA #auto] } protected method SetSomeVariable…
Jordan
  • 1,599
  • 4
  • 26
  • 42
0
votes
1 answer

Hierarchical structure of classes object with Incr Tcl

I'm trying to implement a hierarchical structure of classes/subclasses objects such as: |-- Class1 # mainClass | |-- SubClassA # subClass | `-- SubClassB # subClass `-- Class2 # mainClass …
Mousstix
  • 303
  • 1
  • 3
  • 8
0
votes
1 answer

Tcl error: command already exists in namespace "::"

What means this error? command already exists in namespace "::" Can you provide simple case when this error raises?
Ashot
  • 10,807
  • 14
  • 66
  • 117
0
votes
1 answer

How to dynamically add methods to a class in [incr-tcl]

In Incr Tcl, I receive a gain in programming productivity via changing and then re-eval'ing a class's methods into a running Tcl interpreter, without restarting the application. To do that, I have to define the methods outside of the class…
bgoodr
  • 2,744
  • 1
  • 30
  • 51
1
2