by [Theo Verelst] who holds copyrights but grants free use and modification, preferably informing me, for non-commercial purposes when source is clearly mentioned by email, name and/or url, commercial use requires written permission, meaning I don't give the exploitation rights away just like that. Download info is here: [Bwise - a graphical programming setup] Bwise is a package written completely in tcl/tk, even in pretty basic of such for the major part, to make graphs with blocks and compose programs with them, by letting data flow and executing procedures on them. Though some of the code is pretty heavy on the extended eval use side (read impossible to read but with some effort fine to follow and compact), the idea is that very simple and basic tcl use should suffice on the application side, where the blocks are put to use. This page contains a description, example use and probably some function descriptions. ---- The starting screen is the main window recogniseable by the buttons and the scrollable gray canvas. Also the function editor pops up, which in the top part has a scrollable (press mouse and roll under or above window boundaries) list of all user functions, and in the middle part shows a function when a name in the list is double clicked. The main window is shown in figure 1, [http://195.241.128.75/Bwise/Picts/bw1.jpg] 'figure 1' startup bwise main canvas and buttons. where I used the middle mouse button on the bare canvas to pop up a block creation menu. This is the result: [http://195.241.128.75/Bwise/Picts/bw2.jpg] 'figure 2' a single unconnected procedure block with one input and one output After clicking middle mouse on the yellow block and selecting 'data', a data window for this block is shown, and left on top. [http://195.241.128.75/Bwise/Picts/bw3.jpg] 'figure 3' The data window with all variables defining the blocks" data and procedures The window is a list of fields, one for each tcl variable starting with the name of the block followed by a dot, in this case "proc1.". The blocks are automatically numbered uniquely when they are created, unless they are given a unique name which is possible b manually calling "new***", in this case "newproc", from the console or a console bwise block which can be created by pressing the paper icon in the top menu bar. The variables proc1.in and procin.out contain the input and output data of the block, which are stored per block, even when they are connected up. The most important variable contains the block function, called ***.bfunc, in this case proc1.bfunc. In fact this is a string which contains what could be seen as the body of a procedure, or however: a tcl (when desired also tk) script, in this case an assignment which simply sets the output variable equal to the input variable. Note that because of the dot "." in the name of the variables, the use of the dollar $ to access the content of the variable requires surrounding the whole name of the variable in curly braces, a bit annoying but it works. The left side of the "set" assignment doesn't require this. One could also simply put the cursor in the editable field in the proc1 info window next to the 'proc1.bfunc' variable name and edit the function associated with the block, for instance to: set proc1.out [[expr ${proc1.in} * 2]] when we now put the text cursor in the in proc1.in field by clicking on the entry to the right of the name in the proc1 info window and insert a 1 in the field, and press the "'eval'" button on the bottom of the window, the function in the bfunc field will be evaluated at the highest interpreter level, so that the proc1.out variable, which is real time linked with the entry in the info or data window, will be set to "2". You could make a celcius to farenheit conversion as an example, I don't have that formula handy, or a dollar to euro, or preferably the reverse. Now what"s the block on the canvas doing in all this? Its mainly the graphical representation linked with the variables we just discussed. Calling up the block menu by clicking the middle mouse (or right if you have 2, I'm not sure that doesn't require you to change the 'canmeny' procedure in the 'bwise03.tcl' file for instance, I'll check it out), while pointing over the yellow block with proc1 written under it shows a menu entry "'eval'" which does the same as the button in the info window. Now lets create a few more blocks by right clicking on a free spot on the canvas and selecting entry, mon, and another time proc, on different places on the canvas, and dragging the new blocks around by simply holding the left mouse button down somewhere in their yellow block. [http://195.241.128.75/Bwise/Picts/bw4.jpg] Figure 4, having added some more blocks, calling up the block menu. Now we click on first the Entry1.out pin with the left mouse button, and on the Proc1.in pin, so that both have turned green, and press the green 'wire' button: a wire appears between the Entry and the Proc1 blocks. When you move the blocks around, the wires stay connected to the same pins. Pressing somewhere on the wire we just made will make both pins between which the wire runs green. Now when the 'wire' button is pressed again, the wire disappears, leaving the two pins green. Clearly, we can repeat the wireing idea to connect all blocks up with eachother, for instance in order. We could also do this by commands in the console window: connect wirea Proc1 out Proc2 in connect wireb Proc2 out Mon1 in The result is shown graphically in figure 5. [http://195.241.128.75/Bwise/Picts/bw5.jpg] Figure 5, blocks connected up through wires, block menu popped up for first block in the chain.