÷ƒ’À;è TeX output 1998.01.28:1948‹ÿÿÿÿ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ŸIyóÓߌ˜¼j ptmb7t½TkObjc‘/DocumentationŽŸ©^ïhtml:ï html:Ÿuóßêï html:ŽŸ·Ó(ftp://ftp.smli.com/pub/tcl/)Ž© F¬ó3{Ù ptmr7t¼is–¦7a“scripting“language“and“graphical“widget“set.‘Œï html:Ÿ €L‘0¾TkObjc–?ýis“currently“based“on“ïhtml:ï html:Tcl“7.5,“Tk“4.1ïhtml:ï html:ަ‘0(ftp://ftp.smli.com/pub/tcl/)ަ‘0,–?ýïhtml:ï html:BLT“2.1ïhtml:ï html:ަ‘0(ftp://ftp.neosoft.com/pub/tcl/NEW/)ަ‘0or–?ýïhtml:ï html:BLT“2.3ïhtml:ï html:ަ‘0(http://www.tcltk.com/blt/index.html)ަ‘0,and‘?ýïhtml:ï html:tclobjc-1.2ïhtml:ï html:ަ‘0(ftp://ftp.santafe.edu/pub/swarm/needed-software/tclobjc-1.2.tar.gz)ަ‘0(available–?ýfrom“Swarm“authors).‘ úVery“little“of“this“code“is“library-version“dependent,Ž¡‘0however,–?ýas“most“of“it“works“by“directly“calling“the“Tk“interpreter.ŽŸ8äïhtml:ï html:Ÿ È‘0The–?ýbasic“purpose“of“tkobjc“is“to“package“Tk“functionality.‘ úTherefore,“tkobjc's“behaviourŽ¡‘0is–?ýsimilar“to“the“Tk“toolkit.‘ úFor“simple“usage“one“should“be“able“to“get“fairly“farŽ¡‘0just–?ýby“looking“at“this“document,“the“header“files,“and“the“Swarm“examples:‘ úmoreŽ¡‘0complicated–?ýgraphical“output“will“require“the“programmer“have“some“familiarity“withŽ¡‘0Tk.ŽŸïhtml:ï html:Ÿ‘0„¤ŽŽ©G®ïhtml:ï html:ŸóÓߌ˜G® ptmb7t¿globalTkInterÓÅpŽŸ¤á¼TkObjc–Cšgets“most“of“its“wægork“done“by“talking“to“the“Tcl“interpreter“object“ïhtml:ï html:ó0ˆÛ pcrr7tÀglobalTkInterp¼,‘t€an“instance“of“classŽ¡TkExtra.‘KáStrings–Ãhanded“to“the“interpreter'‘ÿs8s“e•Àv“al:‘;method–Ãare“e•Àv“aluated–Ãby“the“Tcl“interpreter“and“anÙ y“side“e ects“areŽ¡performed.‘DzThe–8ölibtclobjc“library“prošÙ vides“the“functionality“that“glues“Tk“to“ObjectiÀv˜e“C.“Users“with“simple“needsŽ¡neÀvÙ er–€need“to“talk“to“the“Tk“interpreter“directly‘ÿY .ŽŸ ˆmïhtml:ï html:ŸÕÈ‘0„¤ŽŽ¦ïhtml:ï html:Ÿ¿W°gidget–QëBase“ClassŽŸ¤á¼All–ª graphical“widgets“inherit“from“the“Wš™Ÿidget“base“class.‘—¼W˜idget“de nes“most“of“the“behaÌÐviour“needed:‘m°W˜idgets“areŽ¡created–‹ðby“the“user“with“a“particular“parent,‘Žìand“then“"pack"ed“in“order“to“drašÙ w“them“on“the“screen.‘=iAll“widgets“haÌÐv˜eŽ¡three–;µessential“things:‘÷sa“widget“name“used“when“running“Tcl“code,‘I^an“ObjectiÀvÙ e“C‘;¤name“when“sending“messages“fromŽ¡Tcl–€to“those“objects,“and“a“parent.ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹* “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾+–?ýcreateParent:› ú(Widget“*)p“and“ïhtml:ï html:-“setParent:˜(Widget“*)pŽŸ8äïhtml:ï html:© *m‘XWhen–?ýa“widget“is“created“it“needs“to“be“given“a“parent.‘ úThe“parent“widgetޤ ‘Xwill–?ýbe“the“widget's“containing“window.‘ úIf“no“parent“is“given“(ie,“a“parentŽ¡‘Xof–?ýnil),“then“a“toplevel“Frame“will“be“allocated“automaticallyޤ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ýsetWindowTitle:‘ ú(const“char“*)sŽŸÕSïhtml:ï html:Ÿ þ‘XSets–?ýthe“window“manager“title“of“the“top“level“windowŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ýpack,“ïhtml:ï html:-“packWith:‘ ú(const“char“*)cŽŸ8äïhtml:ï html:¦‘XRoughly,–?ýpacking“a“widget“makes“it“draw“on“the“screen.‘ úThe“Tk“packer“allowsޤ ‘Xcomplicated–?ýoptions“to“control“widget“layout:‘ úyou“can“pass“options“via“ïhtml:ï html:À-Ž¡‘XpackWith:¾.‘ úSee–?ýdocumentation“on“Tk“to“learn“more“about“packing“details.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ýgetWidth,“ïhtml:ï html:-“setWidth:› ú(int)n,“ïhtml:ï html:-“getHeight,“ïhtml:ï html:-“setHeight:˜(int)n,“ïhtml:ï html:-“getPositionX,Ž¡‘Dïhtml:ï html:-–?ýgetPositionY,“ïhtml:ï html:-“setPositionX:“(int)n“Y:“(int)n,“etc.ޤ8äïhtml:ï html:¦‘XThese–?ýmethods“allow“you“to“control“the“position“and“size“of“the“widget.ŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ý(const“char“*)getWidgetName,“ïhtml:ï html:-(const“char“*)getObjcNameŽ¡ïhtml:ï html:¦‘XGet–?ývarious“names“for“the“widgets.‘ úThe“WidgetName“is“a“Tcl“name“for“the“window:ޤ ‘Xthe–?ýObjcName“is“the“name“of“the“object“itself.‘ úThese“are“used“if“you“chooseŽ¡‘Xto–?ýsend“strings“off“to“Tcl“directly“for“evaluation.ŽŸ‘0„¤ŽŽ¤G®ïhtml:ï html:Ÿ»¿Simple‘QëW°gidgetsŽŸ 4¼There–€are“a“vÀariety“of“simple“widgets“which“do“straightforwægard“things.Ž©žïhtml:ï html:Ÿ€ÇóÓߌ˜ff ptmb7tÁFrameŽŸNÖ¼Frames–FUare“boxšÙ es“other“widgets“ t“in.‘l—The˜y“correspond“to“the“Tk“"frame"“and“"topleÀv˜el"“widgets.‘l—Frames“can“beŽ¡ne•Àw›O«windo“ws,‘YVor˜subwindo“ws˜in˜an˜eÙ xisting˜windo“w‘ÿY .‘ |Y‘þægou˜only˜need˜to˜create˜frames˜yourself˜if˜bÌÐuilding˜complicatedŽ¡composite–€widgets:‘˜by“defægault,“a“frame“will“be“bÌÐuilt“automatically“for“widgets“without“parents.ަïhtml:ï html:Ÿ€ÇÁLabelޤ(¼Labels–€are“teÙ xt“strings“used“for“displaying“short“information.Ž© *8ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ 9‘:¾-–?ýsetText:‘ ú(const“char“*)tŽŸÕSïhtml:ï html:Ÿ þ‘Xset–?ýthe“label's“text“string“and“resize“it“to“fit.ŽŸŸJïhtml:ï html:ŸrÁButtonŽ¡¼Buttons–€a“user“can“click.‘˜Each“bšÌÐutton“has“a“label“and“a“command“to“be“e•Ù x“ecuted–€when“the“b˜utton“is“pressed.ަïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ ª “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ9ºâ¾-–?ýsetText:‘ ú(const“char“*)tŽºâ¤ÕSïhtml:ï html:© ¤Î‘Xset–?ýthe“button's“text“string“and“resize“to“fit.ŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ A=‘:-–?ýsetCommand:‘ ú(const“char“*)cŽ¡ïhtml:ï html:¦‘Xset–?ýthe“button's“command,“what“to“do.‘ úThis“is“a“Tcl“string“passed“off“toŽŸ ‘Xthe–?ýinterpreter.‘ úSee“the“ControlPanel“code“in“simtools“for“an“example.ŽŸ‘0„¤ŽŽ¤G®ïhtml:ï html:Ÿ6‹¿Input‘QëW°gidgetsŽŸ ¼All–Mcwidgets“which“takæge“input“from“the“user“inherit“from“a“base“class,‘WƒInputW•™Ÿidget.‘¹InputW“idgets–Mcget“their“input“in“oneŽ¡of–€twšægo“w˜ays:‘˜by“being“readable,“or“by“being“link˜ed“to“a“C“vÀariable.ŽŸžïhtml:ï html:Ÿ——ÁInputW½«idget–™™(base“class)ŽŸ î&ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ ‹û‘:¾-–?ý(const“char“*)getValueŽŸ8äïhtml:ï html:¤ A=‘Xread–?ýthe“value“as“a“stringŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetValue:‘ ú(const“char“*)vŽŸÕSïhtml:ï html:¦‘Xset–?ýthe“value“as“a“stringŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýlinkVariable:› ú(void“*)p“Type:˜(int)typeŽŸ8äïhtml:ï html:¡‘XLink–?ýthe“widget“directly“to“a“C“variable“-“any“changes“from“the“user“willޤ ‘Xbe–?ýautomatically“stored“in“the“variable.‘ úTypes“are“ïhtml:ï html:ÀTCL_LINK_INT¾,“ïhtml:ï html:ÀTCL_LINK_BOOLEAN¾,Ž¡‘Xïhtml:ï html:ÀTCL_LINK_DOUBLE¾,–?ýand“ïhtml:ï html:ÀTCL_LINK_STRING¾.ŽŸÉóïhtml:ï html:Ÿ^BÁEntryŽŸe¦¼Handles–€data“of“anÙ y“input“type“-“user“types“in“a“string.ޤžïhtml:ï html:Ÿ——ÁCheckButtonŽŸø¼Boolean–€data“only‘ÿY ,“click“to“set.ŽŸ Îïhtml:ï html:ŸÕÈ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ6‹¿Compound‘QëW°gidgetsŽŸ ¼Some–€TkObjc“widgets“consist“of“seÀvÙ eral“other“widgets“bound“together“into“one“object.Ž¡ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹¶ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýкâÁButtonPÛ$anelޤ¥ºâ¼SeÀvÙ eral–€bÌÐuttons“bound“together“in“one“frame.ŽºâŸ *8ïhtml:ï html:©ïhtml:ï html:ïhtml:ï html:Ÿ ×~‘:¾-–?ýaddButtonName:› ú(const“char“*)n“Command:˜(const“char“*)cŽŸÕSïhtml:ï html:Ÿ ,c‘Xadd–?ýa“new“button“to“the“panel“with“the“given“name“and“command.ŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿ¾ ¿Data–QëDisplay“W°gidgetsŽŸ§™¼TkObjc–€has“twægo“basic“classes“for“displaying“numerical“data.ŽŸžïhtml:ï html:Ÿ,ÁBL‘þ¬áTGraphŽ¡¼A‘’Ðtime–“series“graph“tool,‘×Übased“on“BL›ÿT'‘ÿs8s“graph“widget.‘RÝBL˜TGraph“currently“implements“just“a“basic“graph“withޤ multiple–Ídatasets,‘6AbÌÐut“should“eÀvšÙ entually“support“scaling“and“scrolling.‘ÏF˜or“each“BL‘ÿTGraph“you“create“one“or“man˜yŽ¡GraphElements,›à;one–Ìüper“dataset“to“plot.‘‹GraphElements“can“be“con gured“for“appearance,˜and“data“can“be“added“toŽ¡the–€element“to“draÙ w‘ÿY .ŽŸ ´ïhtml:ï html:¦ïhtml:ï html:ïhtml:ï html:Ÿ ã‘:¾-–?ýtitle:‘ ú(const“char“*)t,“ïhtml:ï html:-“axisLabelsX:“(const“char“*)xl“Y:“(const“char“*)ylŽ©8äïhtml:ï html:¤ ÈÒ‘Xset–?ýlabels“and“title“on“the“graph.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetScaleModeX:“(int)xd“Y:“(int)ysަïhtml:ï html:¡‘Xtakes–?ýtwo“boolean“values“-“whether“to“autoscale“every“timestep“or“insteadŽŸ ‘Xto–?ýjump“scale.ŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetRangesXMin:› ú(double)xmin“Max:˜(double)xmax“YMin:˜(double)ymin“Max:˜(double)ymaxަïhtml:ï html:¡‘Xsets–?ýthe“ranges“for“the“graph,“turns“off“autoscaling“entirelyŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ý(GraphElement“*)createElementަïhtml:ï html:¡‘Xbuilds–?ýa“new“GraphElement“for“you“to“plot“data“withŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýdestroyElement:‘ ú(GraphElement“*)gަïhtml:ï html:¡‘Xremove–?ýthe“given“graph“element,“destroy“the“plot.ŽŸ¶¼GraphElements–Eare“where“the“real“wægork“are,‘qÕwhere“you“giÀvšÙ e“it“data“to“plot.‘ÄgOne“BL‘ÿTGraph“can“haÌÐv˜e“multipleŽ© GraphElements.ŽŸ *8ïhtml:ï html:¤ïhtml:ï html:ïhtml:ï html:Ÿ ×~‘:¾-–?ýsetLabel:‘ ú(const“char“*)labelŽŸÕSïhtml:ï html:Ÿ ,c‘Xset–?ýthe“label“for“this“elementŽ¡ïhtml:ï html:ïhtml:ï html:Ÿ ¶‘:-–?ýsetColor:› ú(const“char“*)color,“ïhtml:ï html:-“setWidth:˜(int)w,“ïhtml:ï html:-“setDashes:˜(int)i,“ïhtml:ï html:-“setSymbol:ަ‘D(const–?ýchar“*)sŽŸÕSïhtml:ï html:Ÿ ,c‘Xchange–?ýthe“apperance“of“the“graph.‘ úThe“argument“to“dashes“specifies“the“dashަ‘Xwidth.‘ úValid–?ýsymbols“are“ïhtml:ï html:Àline“¾(default),“ïhtml:ï html:Àsquare¾,“ïhtml:ï html:Àcircle¾,“ïhtml:ï html:Àdiamond¾,“ïhtml:ï html:Àplus¾,ަ‘Xïhtml:ï html:Àcross¾,–?ýïhtml:ï html:Àsplus¾,“ïhtml:ï html:Àscross¾.ŽŸcïhtml:ï html:ïhtml:ï html:Ÿ ž)‘:-–?ýaddX:“(double)x“Y:“(double)yŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹% “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾add–?ýthe“datapoint“(x,y)“to“the“graphŽºâŸ8äïhtml:ï html:ïhtml:ï html:¤ s‘:-‘?ýresetDataŽïhtml:ï html:Ÿ IW‘Xremove–?ýall“data“from“this“element,“start“overŽŸcïhtml:ï html:ïhtml:ï html:Ÿ åÊ‘:-(BLTVector–?ý*)getXData,“ïhtml:ï html:-(BLTVector“*)getYDataŽ©8äïhtml:ï html:¡‘XGet–?ýthe“data“in“the“graph“as“a“BLTVector“(undocumented)ŽŸŸJïhtml:ï html:ŸX!ÁHistoŽŸí.¼Histogram–QÒdisplay“tool,›[based“on“BL‘ÿT'‘ÿs8s“barchart.‘ 3The“number“of“bins“is“ xÙ ed“at“creation“time,˜then“the“user“hands“theޤ Histo–h‰an“array“of“datapoints“(double“or“int)“to“display“(or“optionally“an“array“of“datapoints“and“ïhtml:ï html:óßêï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾-–?ýtitle:‘ ú(const“char“*)t,“ïhtml:ï html:-“axisLabelsX:“(const“char“*)xl“Y:“(const“char“*)ylަïhtml:ï html:¤ s‘Xtitle–?ýthe“histogram,“give“it“axis“labels.Ž©8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetNumPoints:› ú(int)n“Labels:˜(const“char“*“const*)“l“Colors:˜(const“char“*ޤ ‘Dconst‘?ý*)cŽŸÕSïhtml:ï html:Ÿ t‘Xinitialize–?ýthe“histogram,“tell“it“how“big“its“dataset“is.‘ úLabels“and“ColorsŽ¡‘Xare–?ýarrays“of“strings“(one“string“per“point)“for“text“labels“and“the“coloursŽ¡‘Xof–?ýthe“bars“(the“last“two“arguments“are“optional).ަïhtml:ï html:ïhtml:ï html:¤ s‘:-–?ýdrawHistoWithDouble:› ú(double“*)points,“ïhtml:ï html:-“drawHistoWithInt:˜(int“*)pointsŽŸ8äïhtml:ï html:¡‘Xan–?ýarray“of“points“(two“possible“types)“to“draw“in“the“histogram.ަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýdrawHistoWithDouble:› ú(double“*)points“atLocation:˜(double“*)locations,“ïhtml:ï html:-“drawHistoWithInt:Ž© ‘D(int–?ý*)points“atLocation:‘ ú(double“*)locationsŽŸ8äïhtml:ï html:¡‘XAn–?ýarray“of“points“(two“possible“types)“to“draw“in“the“histogram,“and“an“arrayަ‘Xof–?ýspecific“locations“in“which“to“draw“them“(the“bar“width“at“every“locationަ‘Xwill–?ýbe“of“width“1.0).ŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:ŸÁ¿Graphical‘QëOutputŽŸ§Œ¼TkObjc–x§has“one“basic“class“(and“a“subclass)“for“displaying“graphical“data.‘%The“model“used“here“is“a“2d“raster“display:ަan–Ä5array“of“display“elements.‘æ8Display“elements“are“typically“simply“pixÙ els,‘ÕCblocks“of“a“solid“colour“(speci ed“via“anަXColormap).‘˜Other–€options“are“a“pixmap“(XPixmap)“or“arbitrary“Xlib“display“code“(implementation“of“XDraÙ wer).ŽŸ ˆmïhtml:ï html:Ÿ ‘0¾The–?ýdisplay“widgets“used“here“do“not“have“Tk“counterparts:‘ úthey“are“raw“Xlib“codeަ‘0written–?ýfor“flexibility“and“(relative)“speed.ŽŸŸJïhtml:ï html:ŸX!ÁXColormapŽŸí.¼Mechanism–Œêused“to“map“numbers“in“the“range“[0,›%255]“to“colour“names.‘@WCreate“an“XColormap,˜allocate“colours“in“it,ަand–€pass“it“to“a“Raster“widget“for“draÙ wing.ŽŸ *8ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹3𠓺â ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБ9ºâ¾-–?ý(BOOL)setColor:› ú(Color)c“ToName:˜(const“char“*)colorNameŽºâŸÕSïhtml:ï html:Ÿ HV‘Xset–?ýthe“specified“color“to“the“given“colorname.Ž©8äïhtml:ï html:ïhtml:ï html:¤ äÅ‘:-(BOOL)–?ýsetColor:› ú(Color)“c“ToGrey:˜(double)“gŽŸ8äïhtml:ï html:¡‘Xset–?ýthe“specified“color“to“the“grey“value“in“[0,“1.0].ަïhtml:ï html:ïhtml:ï html:¡‘:-(BOOL)–?ýsetColor:› ú(Color)“c“ToRed:˜(double)“r“Green:˜(double)“g“Blue:˜(double)ޤ ‘DbŽïhtml:ï html:© ©‘Xset–?ýthe“specified“color“to“the“red,“green,“blue“vector“in“the“range“[0,“1.0].ŽŸŸJïhtml:ï html:Ÿ,sÁRasterŽŸÁ€¼2–Žªdimensional,‘ÒScolour“pixÙ el“images.‘E•Raster“is“based“on“a“Tk“frame“widget“with“our“oÀwn“code“for“fægast“display“ofŽ¡images.‘OY‘þægou–F#can“drašÙ w“coloured“dots“on“a“Raster™Ÿ,‘Q¶or“generic“s“(not“documented).‘ORaster“widgets“are“doubleŽ¡bÌÐu ered–Iz-“the“pixšÙ els“you“dra˜w“are“not“actually“put“on“the“screen“until“ïhtml:ï html:À-‘ffdrawSelf“¼is“called.‘vIn“addition,‘{ØRastersŽ¡handle–€mouse“clicks.ŽŸ ´ïhtml:ï html:¤ïhtml:ï html:ïhtml:ï html:Ÿ þõ‘:¾-‘?ýeraseŽïhtml:ï html:¦‘Xerase–?ýthe“window“to“blackŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýdrawSelfŽïhtml:ï html:¦‘Xrender–?ýthe“Raster“on“the“screen“(complete“the“double“buffer)Ž©8äïhtml:ï html:ïhtml:ï html:¤ äÅ‘:-–?ýsetColorMap:‘ ú(XColorMap“*)colormapŽŸ8äïhtml:ï html:¡‘Xsets–?ýthe“colourmap“used“to“translate“logical“colors“to“screen“colors.ަïhtml:ï html:ïhtml:ï html:¡‘:-(XColormap–?ý*)“getColormap;ŽŸ8äïhtml:ï html:¡‘Xreturns–?ýthe“id“of“the“colormapަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýdrawPointX:“(int)x“Y:“(int)y“Color:‘ ú(Color)c;ŽŸ8äïhtml:ï html:¡‘Xdraw–?ýa“point“at“the“given“coordinates“with“the“given“color.ަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýfillRectangleX0:› ú(int)x0“Y0:˜(int)y0“X1:˜(int)x1“Y1:˜(int)y1“Color:˜(Color)cŽŸ8äïhtml:ï html:¡‘Xfill–?ýa“whole“rectangle“with“colorަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetButton:› ú(int)n“Client:˜c“Message:˜(SEL)sŽŸ8äïhtml:ï html:¡‘Xwhen–?ýbutton“n“(ïhtml:ï html:ÀButtonLeft¾,“ïhtml:ï html:ÀButtonMiddle¾,“or“ïhtml:ï html:ÀButtonRight¾)“is“pressed,“sendŽŸ ‘Xthe–?ýgiven“message“to“the“specified“client“object.ަïhtml:ï html:ïhtml:ï html:¡‘:-–?ý(Display“*)getDisplayŽŸ8äïhtml:ï html:¡‘Xreturns–?ýthe“id“of“the“displayަïhtml:ï html:ïhtml:ï html:¡‘:-–?ýhandleButton:‘ ú(int)n“X:“(long)x“Y:“(long)yŽŸ8äïhtml:ï html:¡‘Xfields–?ýthe“button“clicksŽŸffïhtml:ï html:ŸeWÁZoomRasterŽŸÁ€¼ZoomRaster–v@is“a“subclass“of“Raster“that“implements“a“zoomable“image.‘XIt“handles“translation“between“logical“coordi-ŽŸ nates–€and“screen“coordinates.ŽŸ ´ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ þõ‘:¾-–?ýincreaseZoom,“ïhtml:ï html:-“decreaseZoom,“ïhtml:ï html:-“setZoomFactor:‘ ú(int)zŽŸcïhtml:ï html:Ÿ º‘Xchange–?ýthe“zoom“sizeŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹BV “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ºâ ýÆïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾-‘?ý(unsigned)getZoomFactorŽ©8äïhtml:ï html:¤ üí‘Xreturns–?ýan“integer“representing“the“zoom“sizeŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-–?ýhandleConfigureWidth:› ú(unsigned)newWidth“Height:˜(unsigned)newHeightަïhtml:ï html:¡‘Xreconfigures–?ýzoom“when“the“window“is“resizedŽŸŸJïhtml:ï html:ŸD›ÁXDrawer‘þ¬á,‘™™XPixmapŽŸÙ¨¼Using–ÌmXDrašÙ wer“and“XPixmap,‘߈you“can“write“arbitrary“Xlib“code“to“dra˜w“in“the“windoÀw‘ÿY .‘þÞXDra˜wer“is“just“a“protocolŽŸ for–€the“ïhtml:ï html:¾drawOn:X:Y:GC:Caller:‘˜¼message.ŽŸ Îïhtml:ï html:Ÿ ™‘0¾XPixmap–?ýprovides“packaging“for“drawing“pixmaps“onto“displays.ŽŸ 8äïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:¡‘:-–?ýsetFile:‘ ú(const“char“*)filenameŽŸÕSïhtml:ï html:Ÿ `~‘Xdesignates–?ýthe“file“from“which“to“read“the“pixmap“imageŽ©8äïhtml:ï html:ïhtml:ï html:¡‘:-‘?ýcreateEndŽïhtml:ï html:Ÿ 5Ñ‘Xloads–?ýthe“pixmap“and“sets“the“display“and“windowަïhtml:ï html:ïhtml:ï html:¡‘:-(Pixmap)‘?ýgetPixmapŽŸ8äïhtml:ï html:¡‘Xreturns–?ýthe“id“of“the“pixmap“data“structureަïhtml:ï html:ïhtml:ï html:¡‘:-(BOOL)‘?ýgetMaskedŽ©8äïhtml:ï html:¡‘Xreturns–?ýYES“if“a“mask“has“been“set,“NO“if“it“hasn'tŽŸcïhtml:ï html:ïhtml:ï html:Ÿ ÒD‘:-(Pixmap)‘?ýgetMaskަïhtml:ï html:¡‘Xreturns–?ýthe“id“of“the“pixmap“maskŽŸ8äïhtml:ï html:ïhtml:ï html:¡‘:-(unsigned)–?ýgetWidth,“-(unsigned)“getHeightަïhtml:ï html:¡‘Xreturns–?ýthe“width“or“height“of“the“pixmapŽŸ‘0„¤ŽŽŸG®ïhtml:ï html:Ÿò;¿Can‘ÿOvÓÅasŽŸ”¼There–bzare“the“beÙ ginnings“of“a“packaging“of“the“Tk“can™ŸvšÀas“widget“that“allo˜ws“arbitrary“draÙ wing“of“complicated“shapes.Ž© This–€code“is“still“under“dešÀvÙ elopment“and“is“not“thoroughly“documented.‘˜Can™Ÿv˜asŽŸ ˆmïhtml:ï html:¤SGis–€a“subclass“of“W™Ÿidget“and“so“inherits“those“methods“bÌÐut“o•Ù v“errides‘€ïhtml:ï html:¾createEnd.ŽŸžïhtml:ï html:ïhtml:ï html:¡ÁCan‘ÿl”vÛ$asItemŽŸÙ¨¼This–¥»is“the“superclass“of“anšÙ y“item“that“might“be“dra˜wn“on“a“Can™ŸvÀas,›¯)e.g.‘ŠÈthe“geometric“shapes,˜teÙ xtItems,˜etc.‘ŠÈThis“isަan–€abstract“class.ŽŸ ´ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ ‘:¾-‘?ýsetCanvas:‘ úcanvasŽïhtml:ï html:Ÿ 5Ñ‘Xdesignates–?ýthe“id“of“the“Canvas“in“which“this“item“residesŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ üí‘:-‘?ýsetTargetId:‘ útargetŽŸ8äïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹QÒ “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾designates–?ýthe“object“to“which“this“item“refersŽºâ¤8äïhtml:ï html:ïhtml:ï html:© ™‘:-‘?ýsetClickSel:‘ ú(SEL)selŽŸÕSïhtml:ï html:Ÿ i*‘Xsets–?ýthe“message“that“will“be“effected“upon“a“click“on“this“itemŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetMoveSel:‘ ú(SEL)selŽŸÕSïhtml:ï html:Ÿ i*‘Xsets–?ýthe“message“that“will“effect“the“motion“of“the“item“on“the“canvasŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetPostMoveSel:‘ ú(SEL)selŽŸÕSïhtml:ï html:Ÿ i*‘Xsets–?ýthe“message“that“will“dictate“what“happens“after“the“item“is“movedŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýcreateItemŽïhtml:ï html:Ÿ >}‘Xpassthrough–?ýmethod“to“be“implemented“by“subclassesŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýcreateBindingsŽŸ8äïhtml:ï html:¦‘Xestablishes–?ýthe“bindings“for“the“buttons:‘ úbutton“3“registers“a“"click",“buttonŽŸ ‘X1–?ýup“and“down“sets“the“focus,“and“button“1“held“down“initiates“motion.Ž¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýcreateEndŽïhtml:ï html:Ÿ >}‘Xcalls–?ýcreateItem“and“createBindingsŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýclickedŽïhtml:ï html:Ÿ >}‘Xsends–?ýthe“clickselector“message“to“the“referentŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ýinitiateMoveX:“(long)delta_x“Y:“(long)delta_yޤ8äïhtml:ï html:¦‘Xprepares–?ýfor“movement“of“the“item“within“the“canvasŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ kÿ‘0óÓߌ˜ ptmb7tÃCirȹcle‘:‘¸PCan…&váIasItemŽŸ /›ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ â‘:¾-–?ýsetX:“(int)x“Y:“(int)yŽ¡ïhtml:ï html:¦‘Xset–?ýthe“x,y“coordinates“for“the“center“of“the“circleŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetRadius:‘ ú(int)rŽŸÕSïhtml:ï html:Ÿ i*‘Xset–?ýthe“radius“of“the“circleŽŸ ïhtml:ï html:ïhtml:ï html:Ÿ¤ã‘0ÃLine‘:‘¸PCan…&váIasItemŽŸ /›ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ â‘:¾-–?ýsetTX:“(int)tx“TY:“(int)ty“LX:“(int)lx“LY:“(int)lyŽ¡ïhtml:ï html:¦‘Xset–?ýthe“endpoints“of“the“lineŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ kÿ‘0ÃRectangle‘:‘¸PCan…&váIasItemŽŸ q ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ Í]‘:¾-–?ýsetTX:“(int)tx“TY:“(int)ty“LX:“(int)lx“LY:“(int)lyŽ¡ïhtml:ï html:¦‘Xset–?ýthe“two“diagonal“corner“coordinates“of“the“rectangleŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ kÿ‘0ÃT‘þåfextItem‘:‘¸PCan…&váIasItemŽŸ /›ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ â‘:¾-–?ýsetX:“(int)x“Y:“(int)yŽ¡ïhtml:ï html:¦‘Xsets–?ýthe“coordinate“for“the“center“of“the“textŽŸïhtml:ï html:ïhtml:ï html:Ÿ >}‘:-–?ýsetText:‘ ú(const“char“*)textŽŸÕSïhtml:ï html:ŽŸ*ºâïcolor push Black’Ôï color popŽŽŒ‹ ^î “ºâ ýxºâïcolor push Blackïhtml:ï html:ŸüfdŽŽŽ’Ôï color popŽŽ ^ ýБWºâ¾sets–?ýthe“content“of“the“textŽºâŸffïhtml:ï html:ŸG®ÁCompositeItemŽŸ£×¼A‘ƒCompositItem–ƒis“simply“a“Can™ŸvšÀasItem“that“consists“of“se˜vÙ eral“pieces.‘"Ì(Whó7y“doesn'Ñðt“this“inherit“from“Can™Ÿv˜asItem?)ŽŸ The–€interfægace“is“identical“to“Can™ŸvÀasItem“eÙ xcept“for“the“additional“method“ïhtml:ï html:¾moveX:Y¼.“Agó7ain,“this“is“an“abstract“class.ŽŸ *8ïhtml:ï html:¤ïhtml:ï html:ïhtml:ï html:Ÿ ÕÈ‘:¾-–?ýmoveX:“(long)delta_x“Y:“(long)delta_yŽŸ8äïhtml:ï html:ïhtml:ï html:© Ç‘Xpassthrough–?ýmethod“to“be“implemented“by“subclassŽŸ8äïhtml:ï html:Ÿ -‚‘0ÃNodeItem‘:‘¸PCompositeItemŽŸ q ïhtml:ï html:¡ïhtml:ï html:ïhtml:ï html:Ÿ Žà‘:¾-–?ýsetX:“(int)x“Y:“(int)yޤ8äïhtml:ï html:¦‘Xposition–?ýthe“item“on“the“canvasŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ý(int)getX,“-“(int)getY;Ž¡ïhtml:ï html:¦‘Xreturn–?ýthe“x“or“y“coordinate“for“the“itemŽŸ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ýsetString:‘ ú(const“char“*)stringŽ¡ïhtml:ï html:¦‘Xdesignate–?ýthe“string“that“will“label“this“nodeޤ8äïhtml:ï html:ïhtml:ï html:¦‘:-–?ýsetColor:‘ ú(const“char“*)aColorŽŸÕSïhtml:ï html:Ÿ *­‘Xdesignate–?ýthe“fill“color“of“the“nodeŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ýsetBorderColor:‘ ú(const“char“*)aColorŽŸÕSïhtml:ï html:Ÿ *­‘Xdesignate–?ýthe“border“color“of“the“nodeŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetBorderWidth:‘ ú(int)aValŽŸÕSïhtml:ï html:Ÿ *­‘Xset–?ýthe“width“of“the“border“in“pixelsŽŸ8äïhtml:ï html:ïhtml:ï html:Ÿ -‚‘0ÃLinkItem‘:‘¸PCompositeItemŽŸ q ïhtml:ï html:Ÿïhtml:ï html:ïhtml:ï html:Ÿ Žà‘:¾-‘?ýsetFrom:‘ úfromŽïhtml:ï html:Ÿ ‘Xdesignate–?ýthe“object“(node)“that“will“be“the“source“of“the“linkŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-‘?ýsetTo:‘ útoŽïhtml:ï html:Ÿ ‘Xdesignate–?ýthe“node“that“will“be“the“destination“of“the“linkŽ¡ïhtml:ï html:ïhtml:ï html:¦‘:-–?ýsetColor:‘ ú(const“char“*)aColorŽŸÕSïhtml:ï html:Ÿ *­‘Xset–?ýthe“color“of“the“linkŽŸïhtml:ï html:ïhtml:ï html:¤ ‘:-‘?ýupdateŽŸ8äïhtml:ï html:¦‘Xredraw–?ýthe“link“(esp“due“to“motion“of“nodes)ŽŸ‘0„¤ŽŽŸ ïhtml:ï html:¡‘0ÂMarcus–?ýG.“Daniels“ïhtml:ï html:‘¼rïhtml:ï html:Ž¡‘0(mailto:mgd@santafe.edu)ŽŸ8äïhtml:ï html:¦‘0¾Last‘?ýmodified:‘ ú1998-01-08ŽŽŸ*ºâïcolor push Black’Ôï color popŽŽŒømƒ’À;è—T~Óºâ óÓߌ˜ ptmb7tóßê