From 99c864af5edc99fc24efdcde369b5ba8e599f21c Mon Sep 17 00:00:00 2001 From: Detlef Groth Date: Tue, 31 Dec 2024 12:14:36 +0100 Subject: [PATCH] adding oocg(et) abbreviation --- jasspa/macros/tcl.eaf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jasspa/macros/tcl.eaf b/jasspa/macros/tcl.eaf index 2f9071e..06c61a3 100644 --- a/jasspa/macros/tcl.eaf +++ b/jasspa/macros/tcl.eaf @@ -120,7 +120,9 @@ arrsize "array size \parr \P" " array size" "" " \ecCTclOO:\ecA " oocl "oo::class create \p {\r variable options\rconstructor {args} {\r # default options\rmy variable options\rarray set options [list -opt val]\rmy configure {*}$args\r\B\B\B\B}\rmethod configure {args} {\r my variable options\rif {[llength $args] == 0} {\r return [array get options]\r\B\B\B\B} else {\r array set options $args\r\B\B\B\B}\r\B\B\B\B}\r\B\B\B\B}\r\P" " oocl" oome "method \p {} {\r my variable options\r\B\B\B\B}\r\P" " oome" +oocg "method cget {key} {\r my variable options\rif { [lsearch -exact [array names options] $key] == -1} {\r return [error -code \"Error unkown key '$key'! Valid options are '[join [array names options] ',']'\"]\r\B\B\B\B} else {\r return $options($key)\r\B\B\B\B}\r\B\B\B\B\r}\r\B\B\B\B" " oocg" ooob "set \p [clsname new -opt val]\P" " ooob" + "" "" "" " \ecCSnit:\ecA " snitwidget "snit::widget \p {\r constructor {args} {\r $self configurelist $args\r }\r}\P" " snit::widget" snittype "snit::type \p {\r constructor {args} {\r $self configurelist $args \r }\r}\P" " snit::type"