Version 2 of Bwise combined with Maxima

Updated 2004-07-14 16:42:55 by TV

by Theo Verelst

Bwise is a sort of interactive visual graph based programming environment (written in Tcl/Tk), and Maxima is a pretty strong and extensive Math package capable of most average and more than a few more than average mathematical manipulations and computations, with a Tk (and tcl) user interface.

I'm convinced a combination is a very fruitfull idea, so without all too much prior knowledge about Mazima I started to combine the two, to begin with simply in the same wish, which needs to come from Maxima, because it is an application (on windows) which has tcl/tk 8.4.1 built in, but compiled in.

See the maxima page for examples on it's use. I only used it as yet on windows (XP) which works fine, not on an X based system (yet) though that should work, too, apart from that libraries seem to be needed. There are various pages on bwise and it's use and ideas, simple and complicated, see bwise applications and examples.

It appears, after starting up Maxima, and opening is tcl console, that mainly the application has about 5 toplevel widgets, of which we are mainly interested in .maxima and .browser . The latter one, and it's buttons are not really needed to begin with, so we can pack forget it, and we leave the top menu in place.

Using the console again, we can source in bwise, for instance the 0.34 version, which will open the main window in the same toplevel as the Maxima interpreter window is open, and a new window for the procedure list will open, too. Now we have the two applications running together, which works fine, the bwise popup menus seem to work, and it's normal operations and data windoes, too.

Now let's look at how maxima can be interacted with, after packing the bwise window with -side top -expand y -fill both, setting the size of .maxima window to conf -width 0 -height 0, and the same for it's children as far as needed, so that the bwise and maxima windows can be enlarged at the expense of the other under control of the maxima sliding horizontal control line.

(Listing an existing applications widget hierarchy is easy with ilist which is in bwise.)

Looking in the sources of maxima, the tcl files are under maxima-5.9.0/interfaces/xmaxima/Tkmaxima , where looking at 'bindings.tcl' it appears there are some top level bindings into the maxima interpreter which take the line with the current cursor of the tk text widget, and interpret and normally process the line as the user presses return.

Checking in the bwise procs_window, it appears the function and argument

   CMeval .maxima.text

Will do this, and we can treat the main maxima interpreter window as a Tk text widget (it appears to simply be one), where input can be entered in through a script like this:

 .maxima.text insert end 1+2\;
 CMeval .maxima.text

Which leads to the expacted answer.

Now we already could start to use bwise with it.

I've made a small example bwise network with two blocks following a terminal block (which doesn't yet get saved right, mind you !) of which the first inserts it's input data at the end of the maxima text widget, and the second calls CMeval, which already works:

http://82.168.209.239/Bwise/maxima1.jpg