How to access a View in a Form

From: [at]} <Wojtek>
Date: Wed, 17 Feb 1999 19:42:36 -0800

Dear Experts:

I want to change something in a View. The following
procedure works from the menu, but it does not work
when I attach it to a button in a form:

PROCEDURE FixCaptions*;
VAR
        v: GrViews.View;
BEGIN
        v := GrViews.Focus();
        IF (v # NIL) THEN
          (* do something *)

The GrViews.FocusView was stolen... grr... borrowed from
Wolfgang's package named Graph (a very good starting point):

PROCEDURE Focus* (): View;

        VAR v: Views.View;
BEGIN
        v := Controllers.FocusView();
        IF (v # NIL) & (v IS View) THEN
                RETURN v(View)
        ELSE
                RETURN NIL END
END Focus;

It works from the menu, but does not seem to work when
the GrView is embedded in a Form together with the Button.
It looks like the focus view is then the whole Form,
not the sub-view. This does make sense. So, how do I
make it work?


I am scratching my head over Wolfgang examples that
apparently do work, even though my Forms do not work
when I am trying to compose mine similar to his.
One such form is his Sort form being a part of his Edu
package (distributed with no source, so it is hard
to Edu-cate oneself on that example). In particular,
I cannot examine Edu-cational version of Focus because
source is not available. (Another problem with Edu
is that the SortView is wrapped in a scroller, and
I am not sure how do I penetrate this firewall
to examine how the view was put there, named,
or what kind of trick was played to make it work).


Another example is Graph. There is one Form there that
puts a caption into the focus Graph view. Perhaps when
this particular Form is invoked from the menu, the focus
view is still available, and thus the form does not have
the focus problem. No enlightment here either.

I looked at Forms docu and it does not seem to discuss
control --> View communication, and in particular how to
locate a given view in the form. Then I looked at Controllers,
and also did not find an (easy) answer.


Under System-3 every Gadget has a name and thus can be located
by name. How do I arrange similar control --> View communication
in a Form under Black Box?

Thank you in advance for any hint.

Wojtek
Received on Thu Feb 18 1999 - 05:00:33 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:42 UTC