ET++ is a portable and homogenous Object-oriented class library integrating user
interface building blocks, basic data structures, and high level application framework
components. ET++ eases the building of highly interactive applications with consistent
user interfaces following the direct manipulation principle. The ET++ class library is
implemented in C++ and can be used on several operating systems and window system
platforms. Since its initial conception the class library has been continuously
redesigned and improved. It started with an architecture which was close to MacApp.
During several iterations a new and unique architecture evolved. A byproduct of the
ET++ project is a set of tools, which were designed to support the exploration of ET++
applications at run-time.
設計模式一書引用的主要參考例程,一個跨平臺的應用框架,基于C++實現,是學習面向對象的經典源碼.
I made a lot of changed on this object,such as *
// 1.Encapsulates all code in one userobjet,since PB does not *
// support "Address of Function" , so we can not set new *
// WndProc, just makes the object more easy to use. *
// 2.Uses structure array instead of Datastore *
// 3.Calc width of menuitem at runtime(MEASUREITEM) *
// 4.Draw disabled status
看n2實例 #Create a simulator object
set ns [new Simulator]
#Define different colors for data flows
#$ns color 1 Blue
#$ns color 2 Red
#Open the nam trace file
set nf [open out-1.nam w]
$ns namtrace-all $nf
set f0 [open out0.tr w]
set f1 [open out1.tr w]
#Define a finish procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exit 0
}
#Create four nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
#Create links between the nodes
$ns duplex-link $n0 $n2 1Mb 10ms