Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!newshost.marcam.com!usc!howland.reston.ans.net!Germany.EU.net!EU.net!chsun!hslrswi!news
From: Thomas Gasser <gasser@hasler.ascom.ch>
Subject: Re: How to find out which view has the focus?
X-Nntp-Posting-Host: hslrswi.hasler.ascom.ch
Content-Type: text/plain
Message-ID: <1995Jun20.080955.28565@hasler.ascom.ch>
To: gasser@hasler.ascom.ch
Sender: news@hasler.ascom.ch
Content-Transfer-Encoding: 7bit
Organization: Ascom Hasler AG, Bern, Switzerland
References: <3rs4dp$qdb@news.tuwien.ac.at> <3rshtd$n8b@cc.iu.net>
Mime-Version: 1.0
Date: Tue, 20 Jun 1995 08:09:55 GMT
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4m)
X-Url: news: 3rshtd$n8b@cc.iu.net
Lines: 51

From: mcs@iu.net (Bob Moore)
Newsgroups: comp.lang.smalltalk
Subject: Re: How to find out which view has the focus?
Date: 16 Jun 1995 18:18:21 GMT
Organization: MCS Data Services, Inc.
Mime-Version: 1.0
Message-ID: <3rshtd$n8b@cc.iu.net>
References: <3rs4dp$qdb@news.tuwien.ac.at>

In article <3rs4dp$qdb@news.tuwien.ac.at>, e8602098@stud1.tuwien.ac.at 
says...
>
>
>I'm trying to create an online help system for VisualWorks which should
>provide help on the focosed view when you press a certain help key.
>
>The problem I cannot solve up to now is: Which view has the focus? Is there
>any way to find this out?
>
>Thanks in advance for any answers, hints or suggestions.
>

To get the view's controller which is in the current "screen" (if it
is an Application Model subclass) try:

	anApplicationModel builder keyboardProcessor currentConsumer

where anApplicationModel could also be 'self' if you have internal
hooks to your on-line help system.

If you are working with multiple open screens, to get the active
screen from the system, try:

	ScheduledControllers activeController

Then send the 'builder keyboardProcessor currentConsumer' message
string to the active controller's model.

Hope this works out for you.

--------------------------
Robert D. Moore
MCS Data Services, Inc.
P.O. Box 061899
Palm Bay, FL 32906-1899
--------------------------
e-mail: mcs@iu.net
Phone/FAX: (407) 728-5644
--------------------------


