🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.news
2 messages
2 total messages Started by Don Kneller Wed, 02 Sep 1992 22:47
Input Focus problem under OW 3.0
#451
Author: Don Kneller
Date: Wed, 02 Sep 1992 22:47
39 lines
1609 bytes
I have encountered a strange problem with Input Focus that is
perplexing. I have an subclass (called a "view") of ClassBaseWindow
that has as part of its methods:

	/NewInit {
		/NewInit super send
		/Keyable? true store
	} def

	/KeyStart {	% event => [] true
		pop [ /StandardKey ] true
console (KeyStart\n) [] fprintf
	} def

	/StandardKey {	% event => -
		pop
console (StandardKey\n) [] fprintf
	} def

An event manager is created, and the instance of the view is
is created and activated:

	emgr /activate view send

Now here is the problem:  Under both OW 2.0 and OW 3.0 I see a "KeyStart"
message every time the mouse enters the view. As well, the input focus
bar changes to show I have the focus.  Under OW 2.0, each press of a
standard key brings up a "StandardKey" message.  BUT under OW 3.0 each
press results in a beep.

Has anyone seen anything like this before?  Please let me know.  Thanks.

	Don Kneller
	University of California, San Francisco
	kneller@picasso.mmwb.ucsf.edu

--
Donald G. Kneller
University of California, San Francisco
Re: Input Focus problem under OW 3.0
#390
Author: Pat Lashley
Date: Tue, 08 Sep 1992 02:07
41 lines
2132 bytes

I think I may have an idea what your problem is:

In article 715474078@dufy.mmwb.ucsf.edu, kneller@dufy.mmwb.ucsf.edu (Don Kneller) writes:
>I have encountered a strange problem with Input Focus that is
>perplexing. I have an subclass (called a "view") of ClassBaseWindow
>that has as part of its methods:
>
>	/NewInit {
>		/NewInit super send
>		/Keyable? true store

This is probably not doing what you expect.  Unless you have explicitly
made /Keyable? an instance variable, or overridden it in your subclass,
this will change the default value inherited from ClassCanvas.  Which
means that -every- canvas which is inheriting that value will think that
it should be Keyable.  (This will take effect when the canvas is activated.)

If you really want to explicitly set /Keyable? in /NewInit, you should
use `/Keyable? true promote', or more cleanly `true /setkeyable self send'.
But a much better approach is to simply put `/Keyable true def' in your
subclass definition.

I don't have the 2.0 sources readily availiable, but it is possible that
we defined /Keyable? as an instance variable in that version.  We later
determined that it was much more optimal to inherit default values from
the class and only override them if they are explicitly changed.  (This
also makes it much easier to dynamically override variables which should
be set from .Xdefaults values.  But don't look at how we did the .Xdefaults
stuff in OW3.0 - it was completely replaced in 3.0.1, with a different API.)

>	} def



-Pat

---
PMLashley	plashley@Sun.COM    SunSoft:NeWS/TNT
	"Those who do not know NeWS are doomed to recreate it - badly."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads