Version 9 of example simple bwise widget block use

Updated 2004-06-05 08:21:59

by Theo Verelst but of course as always feel free to add.

In this time of UI confusion and a lot of great looking things getting started (in general I mean not tk) it is not so clear anymore what the elements of a UI can simply be and how they could work together in a simple enough or effectively defined way.

Object models get in the way, detailed knowledge about graphics and process scheduling are needed, and the programming of simple graphical examples since the time of windows and X has not been exactly trivialized the last decades.

It should be possible to keep some things simple enough though, and this page, building on the bwise package, should at least at second thought make some things simpler and more overseeable for some not very complicated or involved User Interface examples.

Check out the bwise page for download links, and a bwise introduction with graphical examples. Currently this one-file version of bwise is the latest: [L1 ] ; download it and run it with wish or double click it. In fact you might want to add command(s) to the bottom of the file (or a personal startup script calling it) to make sure a console window comes up:

 # my startup file for bwise
 set mybwisepath "" ;        # fill in when you want/need, current dir per default
 source [file join $mybwisepath bwise034.tcl]
 console show                # when on windows (and I guess some old macs)
 # source unixconsole.tcl    # when you are on linux/unix/osx (I guess)

You should now see the bwise main window (in the . toplevel), the procedure window, and a console window to type commands in on your screen.

for the simplest idea of how a UI can work the bwise way, create these blocks:

 newentry 60 30 {} {} 162 79
 newmon 0 80 65 {} {} 375 79
 newproc {} {} in out 40 {} {} 277 79

and connect them up:

 connect {} Entry1 out Proc1 in 
 connect {} Mon1 in Proc1 out 

Now fill in a value in the leftmost entry, which will act as input entry, and right-click on the yellow part of that block and select Funprop (functional propagate). The network will get activated to transfer the value you entered in the entry to the Proc1 block, which simply copies the value, and then that value will be transfered to the in pin of the Mon block, which when automatically activated will show it in the text window.

http://82.168.209.239/Bwise/uiexas1.jpg

In fact when <return> is pressed in the entry, the chain will also get activated because of a standard binding at the time of the Entry creation, but this binding is lost when the canvas is saved and reloaded, and the method is a 'flooding' type of network 'run' method, which is most of the time less efficient, and sometimes ***very*** slow, for big graphs.

bwise deals with the calling of the blocks in order, that on itself isn't directly a UI related subject, but it can be important in the context. Here, 3 blocks are easily understood to be executed in order (from left to right) as an input receiving block, a currently transparent block, and a text output visualize block. It is possible for the computation to be a lot more complicated in structure, and to require many inputs and outputs, and that is where bwise comes in, but that isn't the subject of this page.


For saving the widgets of the example above, you'll need the updated save procedure from Saving Bwise widgets on the canvas . just paste it in the console before you press the Save button.