Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!csd4.csd.uwm.edu!bionet!agate!ucbvax!hplabs!hpfcdc!hpldola!jg
From: jg@hpldola.HP.COM (Joe Gilray)
Newsgroups: comp.sys.atari.st
Subject: Re: Designing HIs under GEM
Message-ID: <11830049@hpldola.HP.COM>
Date: 18 Aug 89 18:22:08 GMT
References: <11830048@hpldola.HP.COM>
Organization: HP Elec. Design Div. -ColoSpgs
Lines: 51


First, thanks to those of you who have responded to my base note so far.
I look forward to some more interesting discussion.

Second, more in the HIs (or do you say GUIs) saga:

I wanted to create an FTEXT object which could be used two different
ways.  What I mean is that it could prompt the user for one field or
another.  For example, it might say
                                      Enter Category: ___
at one point or
                                      Name: ___
at another.

Note that the number of underscores in both cases is the same,
although in general I don't think they should have to be.

I tried to accomplish this in two ways (both really the same in essence):
Method One: copy directly into the Object tree before displaying the tree
    obspec = (TEDINFO *) (tree + THING)->ob_spec;
    strcpy(obspec->te_ptext, "@@@");
    strcpy(obspec->te_ptmplt, "Name: ___");

Method Two: (credit to Tim Oren and his PROGEM series) copy into a local
variable and then set Object to point to local variable
    obspec = (TEDINFO *) (tree + THING)->ob_spec;
    strcpy(localtext, "@@@");
	obspec->te_ptext = localtext;
	obspec->te_txtlen = strlen(localtext) + 1;
	strcpy(localtmplt, "Name: ___");
	obspec->te_ptmplt = localtmplt;
	obspec->te_tmplen = strlen(localtmplt) + 1;

Note that the te_pvalid string is not touched in either case, it is
left as it is the original Object tree - pointing to "XXX".

Neither method works, in both cases it appears that the edit takes
place on the box where the original Object tree thinks it should.
If the original tree had "MMM: ___" as a template and I replace
it (using methods one or two above) with "Name: ___" the dialog
will only show "Name: __" and the cursor will go off the end of
the two shown underscores, also sometimes the system will crash.
If I replace "MMM: ___" with "Name:___" (note missing space)
everything is fine.

What am I doing wrong, or not doing.

Thanks for any help!

Yours,
Joe Gilray