Re: Joust in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg98267] Re: Joust in Mathematica
- From: "David Park" <djmpark at comcast.net>
- Date: Sun, 5 Apr 2009 06:31:54 -0400 (EDT)
- References: <gr21m6$lr4$1@smc.vnet.net> <6221704.1238754373701.JavaMail.root@m02>
Very nice, Albert! Maybe a horizontal scrollbar, and then what are the chances of adding an invisible locator or EventHandler to alter the width of the left hand panel? David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: Albert Retey [mailto:awnl at gmx-topmail.de] Hi, > I've been wondering how to set up something that behaves like the Java Joust > in Mathematica: http://www.ivanpeters.com/ we all use them every day on on > windows machines, so I am wondering how to implement something like it in > Mathematica. At first, I thought of using GraphPlot or TreePlot, but > then started to wonder if OpenerView and Opener could be trained to behave in a more > general way. Has anyone thought about this already, or got some working examples? I think OpenerView isn't providing the looks, but the functionality, depending of course what exactly you have in mind. What exactly are you missing? Here is some code for Mathematica 7 you might want to play with: tree = "A"["B"["x", "y", "z"], "C"["f"["g"["asdf"]]]] ov[a_String] := Button[a, content = a] ov[expr_] := OpenerView[{Head[expr], Column[ov /@ (List @@ expr)]}] CreateDialog[{Dynamic[ Row[{Panel[ Pane[ov[tree], ImageSize -> {100, 200}, Scrollbars -> {False, True}]], Panel[Pane[Dynamic[content], ImageSize -> {200, 200}]]}]]}] hth, albert