>>>>> "Dekel" == Dekel Tsur <[EMAIL PROTECTED]> writes:

Dekel> After reading the ui file, we have a representation of the menu
Dekel> by a rooted tree, whose nodes are instances of the Menu class
Dekel> (if I read the code correctly, the edges of the tree are stored
Dekel> using the submenu_ strings, and not with pointers). The expand
Dekel> function (it can be implemented as a method, but lets assume it
Dekel> is a function) receives some node in this tree (the root in the
Dekel> case of gnome/kde, or a child of the root in the case of
Dekel> xforms) and does the following: It traverses the node and its
Dekel> descendents, and creates a copy of the scanned subtree, but in
Dekel> the copy tree, the "special" items are expanded. When expanding
Dekel> the TOC, new nodes may be added to the copy tree. The copy tree
Dekel> is then passed to the frontend code, so the frontend code just
Dekel> need to traverse the tree it receives, and process it.

To put it another way, I thought I could just add a Menu* member in
menuitem and that Menu::expand would just populate that for items of
type Submenu for Toc and Ref. I have a few questions, though:

- if there is a need for an "update" menu entry for gnome, expand()
  should be aware of that somehow. Another solution would be that
  expand() leaves the entries it has expanded in place, and that the
  frontend would be free to either ignore them or take special action.

- for the refs menu, it seems to me that the special entry should just
  provide a list of references (as submenus), not the whole refs menu
  with four times the same information. 

- why not modify the refs menu to something similar to

  (o) Insert Reference
  ( ) Insert page reference
  ( ) Insert pretty ref
  ( ) Goto ref
  [...]
  -----------------
  label1...label10 >>
  label11...label21 >>

  It seems to me that this would be less confusing than having five
  submenus with the same contents (and you have one less click when
  using often the same function). With this view of things, only the
  part under the separator would be a special entry. The rest could be
  handled via normal stuff.

Dekel, comments?

JMarc

Reply via email to