Canvas: Am I headed in the right direction? 
Author Message
 Canvas: Am I headed in the right direction?


I wanted to outline my current plan for a project I am working on and see
what more experienced tcl/tk users think.  I've used tcl/expect for several
months, but until now have not used itcl or tk.  I'm using the first edition
of the Welch book for tk information, the O'Reilly "TCL/TK tools" book for
itcl information and the "Exploring Expect" book by Libes for expect.  I've
checked the net for information (FAQs and such) but most info out there seems
to look at the details and not give much an overview or big picture for
nontrival projects.

I wish (bah, unintended pun) to have a graphical representation of a group of
hosts and their (hierarchical) relations.  Basically a directed graph for
system and custom application administration.  Click on a host, fill in a
popup dialog and it can spawn an expect script to remotely do stuff.  So I'm
trying to use itk and iwidgets to implement the interface.

I've created a scrollable canvas, and been able to create images on the
canvas for each host and lines between the hosts in test programs.  All the
examples I've seen so far seem to be simple toy examples, which may actually
be all I need, but I'm not sure.  Where do I handle redraws?  How do I handle
updates to the graph when the data structure changes?  Do I delete all the
canvas objects and recreate them?

Here's an simplified outline of the program structure so far:
source class_definitions_and_bodies.itk # classes for hosts and VisualRep
source menus.itk #defines menus and set bindings to procedures

[various procedures:  load/save/modify data structures]

create paned frame, scrolled canvas and pack 'em
set binding to repack canvas when frame changes size
execute procedure to draw host graph

I've used and modified the examples from the itcl chapter in the O'Reilly
book.  And before I go any farther with the style used in those examples, is
there a general idiom for these types of graphical apps?  Ones with lots of
graphical objects and dialogs?  I have a feeling that this could get ugly
since it seems that global data is used frequently due to the command
binding.  Dialog boxes also seem to need alot of globals to pass data.
Anyone know of a nice clean design that I could use as an example?

I've also implemented a sort of persistance for the data structures in which
the itcl objects print their class, object name and state in a "-name value"
pair and are able to be read back in using the eval/configure feature.  One
drawback is that variables must be public in order for this to work.  Are
they better or other ways to implement persistent objects in itcl?

Eddy Kim
Post or email

Tue, 20 Jun 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 


2. beginner needs pointing in the right direction!

3. A favour, or pointer in the right direction!

4. Point me in the right direction

5. Any Help Appreciated : Point me in the right direction

6. Extremely Newbie wants to program and pleads to be pointed in the right direction

7. I am thinking about becoming a Head Hunter

8. I want to make sure I'm heading in the right direction.

9. VO my understanding,am I right?

10. Am I Right?

11. Am I on the right track?

12. Am I on the right track?


Powered by phpBB® Forum Software