Using a DOT graph as a basis for tree GUI

I want to use a graph that is generated by DOT (pyDot in python) as the basis for an interactive Tree-structured GUI in which each of the nodes in the Tree could be widgets.

The tree will basically be a binary Morse Code tree which start at the top node and navigate down the tree to their desired letter and select it. The node they want to select should be highlightable, and the contents (letters) of should be able to be changed based on user input.

Basically I want the nodes to be turned into full scale objects with tunable parameters that change as the interface is used. Can anyone point me in the right direction in order to do this?

Is there any other way to accomplish the same result in wxPython?

Thank for your help!

Rishi Sharma wrote:

I want to use a graph that is generated by DOT (pyDot in python) as
the basis for an interactive Tree-structured GUI in which each of the
nodes in the Tree could be widgets.

The tree will basically be a binary Morse Code tree which start at the
top node and navigate down the tree to their desired letter and select
it. The node they want to select should be highlightable, and the
contents (letters) of should be able to be changed based on user input.

I understand the desire to turn a Dot graph into clickable objects.
What I don't understand is how this is possibly useful in a Morse code
app. There is only one Morse code graph. It's never going to change.
What are they going to highlight? .-- is always W.

Basically I want the nodes to be turned into full scale objects with
tunable parameters that change as the interface is used. Can anyone
point me in the right direction in order to do this?

I sent code to generate the positions, and Chris sent some suggestions
on how to generate the UI.

Is there any other way to accomplish the same result in wxPython?

This is not necessarily a good fit for wxPython. You need all custom
drawing. A wx.glcanvas might work out, but you might be better served
by looking at Kivy. It has a different philosophy, but it was designed
for cuter UIs than what one can build with wx.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

I sent code to generate the positions, and Chris sent some suggestions
on how to generate the UI.

and I couldn't help myself, so here is a sample implementation, using
Tim's code for generating the node positions. Note that this is NOT
well-structued code, it's a minimal example for how to get what you
want from FC.

See the sample I pointed to earlier for how to make the nodes editable.

This is not necessarily a good fit for wxPython. You need all custom
drawing.

sure, but wx is fine for that -- particularly if you use a drawing lib
like FloatCanvas or wx.OGL

A wx.glcanvas might work out,

DO NOT GO there! way too much work, and you don't need hardware
acceleration for this sort of thing.

but you might be better served
by looking at Kivy. It has a different philosophy, but it was designed
for cuter UIs than what one can build with wx

Kivy might work quite well, yes, but you are getting inot a whole pile
of complications that I wouldn't get into unless you want a
touch-screen app...

node_tree.py (7.13 KB)

···

On Wed, Jul 24, 2013 at 12:05 PM, Tim Roberts <timr@probo.com> wrote:

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Chris Barker - NOAA Federal wrote:

···

On Wed, Jul 24, 2013 at 12:05 PM, Tim Roberts <timr@probo.com> wrote:

I sent code to generate the positions, and Chris sent some suggestions
on how to generate the UI.

and I couldn't help myself, so here is a sample implementation, using
Tim's code for generating the node positions. Note that this is NOT
well-structued code, it's a minimal example for how to get what you
want from FC.

Nice work -- I'm going to save this in my set of examples.

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim. Now you make me want to clean it up!

Also, this(as of today) and a bunch of other examples of stuff you can
do with FloatCanvas is in the wxPython SVN:

http://svn.wxwidgets.org/svn/wx/wxPython/3rdParty/FloatCanvas/Demos/

-Chris

···

On Wed, Jul 24, 2013 at 1:20 PM, Tim Roberts <timr@probo.com> wrote:

Nice work -- I'm going to save this in my set of examples.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov