Lisp HUG Maillist Archive

accepting input in tree-view widgets

Hello, list,

I am implementing an outliner, for my own amusement.  This is my first
CAPI project, and my first substantive GUI project of any kind.

I'm using an interface with a tree-view on one side and an editor-pane
on the other.  I'd like to have a keyboard shortcut to add a node to
the tree, and I'd like it to be (for example) "i".

I've tried many things, and none work to my satisfaction, and most not
at all:

  tree-view is not an output-pane and does not accept :input-model as
  an initarg.  I tried putting the tree-view inside a
  simple-pinboard-layout, and this did not work.  Apparently the
  input-model of the tree-view overrides the input-model of the
  simple-pinboard-layout, which makes sense, I suppose.

  I added a menu to the interface with "i" as the accelerator, but
  this makes the "i" key unusable in the editor-pane.  I added a
  pop-up menu to the tree-view with "i" as an accelerator, but that
  doesn't work.

  I created both a class and an interface that inherited from both
  output-pane and tree-view (though certainly defining a class and an
  interface should be more-or-less equivalent in this case, but I
  wasn't sure), and in both cases I got errors -- different errors
  depending on which came first in the superclass list.  If
  output-pane came first, I got

    No applicable methods for #<STANDARD-GENERIC-FUNCTION
    PORT-GRAPHICS-STATE 2129806A> with args (NIL)

  If tree-view came first, I got

    The slot CAPI::INITARGS-FOR-IMPLEMENTATION is unbound in the
    object #<TREE-WITH-INPUT TREE-PANE [-1 items] 22B10C0B> (an
    instance of class #<CAPI::CAPI-CLASS TREE-WITH-INPUT 222C592F>).

  I even tried to hack the input-model of the pane-implementation of
  the tree-pane to include my callback, and it didn't work.  (I fact I
  set the input model to include *only* my callback, and it didn't
  work, which leads me to believe that I wasn't actually *succeeding*
  in setting the input model of the implementation pane, even though
  it appeared to work, even in the Inspector tool.)

Is there some obvious (or unobvious! :) way to do this that I'm
missing, or would I actually have to reimplement the entire tree-view
class?

Thanks for any help, clues, or even LARTs.

-- Larry


Re: accepting input in tree-view widgets

It would be convenient if tree-view were implemented as a pinboard.  
Have you considered using a graph-pane?

Mitch


Updated at: 2020-12-10 08:42 UTC