Tk Library Source Code

Artifact [eb2c7f0542]
Login

Artifact eb2c7f05424d039d5d6649bbefd9044626139ff7:

Attachment "snittest.tcl" to ticket [1950457fff] added by matzek 2008-04-24 15:40:11.
# snit debugging

puts "Tcl version: [info patch]"
puts "snit version [package r snit]"

snit::type gFoo {
    component Other -inherit yes

    constructor args {
	install Other using gBar $self.other
	$self configurelist $args
    }

    destructor {
	catch {$self.other destroy}
    }

    method {is foo} {} {
	return "This is gFoo 1!"
    }

    method isFoo {} {
	return "This is gFoo 2!"
    }
}

snit::type gBar {
    method {is bar} {} {
	return "This is gBar 1!"
    }

    method isBar {} {
	return "This is gBar 2!"
    }
}

set gf [gFoo .gf]

foreach m {{is foo} isFoo {is bar} isBar} {
    catch "$gf $m" msg
    puts "\[$gf $m\] := $msg"
}

$gf destroy