[net.micro.mac] ICONS in buttons

phil@sivax.UUCP (05/09/86)

I am writing an application that could use ICONS in the buttons of a
display item.  Curently, I have a blank button and place an ICON directly
over it.  The ICON edit item # is greater than the button itm #, so it
displays correctly, both items are enabled.  The moment the button/icon is
clicked, the box highlights and the unhighlight, clears out the icon!! I
tried disabling with part code 255 the button, so only the icon is active,
but then a click on the icon/button is not returned through modaldialog.

It seems only the lowest edit item # in a position is checked by modaldialog
and other sys calls, at one match, they exit, not checking for others in the
same position if the first is disabled.

Any ideas on how to put a picture (icon) in a button???

Phil Hunt

dolf@uva.UUCP (Dolf Starreveld) (05/13/86)

They only real solution to your problem seems to be the writing
of a new control definition procedure.
There you could handle button type control that does not have a title,
but which does have an icon instead.

--dolf

-- 
			Dolf Starreveld
			Computer Science Department, University of Amsterdam


Usenet:			{seismo, philabs, decvax}!mcvax!dolf@{uva,fvi}
Normal mail:		Dolf Starreveld
			Computer Science Department
			University of Amsterdam
			Kruislaan 409
			NL 1098 SJ  Amsterdam
			The Netherlands

rcopm@yabbie.oz (Paul Menon) (05/17/86)

In article <58@uva.UUCP>, dolf@uva.UUCP (Dolf Starreveld) writes:
> 
> They only real solution to your problem seems to be the writing
> of a new control definition procedure.
> There you could handle button type control that does not have a title,
> but which does have an icon instead.
> 
    There are a couple of other solutions...

    (i)	Create a user item (a la Dialog Manager) which can just be a rectangle.
    	You dictate exactly what happens when mousy poops in it. You have to 
	take care of drawing (via a user filter) updating etc... but at least 
	it is on the same (dialog) level.  An example of user items in dialog
	boxes can be found in MacTutor June '85. The code has some redundancies
	(controls being drawn twice... note that the DM takes care of drawing
	all controls in a window for an update event) and glaring 
	inconsistencies (illustrations are not a result of the program...
	take careful not of the scrollbar positions wrt the selection box).
	However, it gives one a good feel about what's happening at the highest
	level of the Mac, the only level (opinion only) to really be 
	programming at.  I wrote a TML Pascal example program using this as an
	outline, I might still have it somewhere...

    (ii)If you are lucky enough to have a MacPlus (grrrr!!), then you can make
	full use of the List Manager (huh? I hear the replies already).  A
	good example can be found in Mactutor (once again) May '86.  I have
	not examined it thoroughly or even implemented it.  Further, since the
	List Manager is a relatively new arrival, I am still naive on the
	subject.  It seems a powerful package though, and could satisfy your
	needs.

			GOOD LUCK

Paul Menon.

    Dept of Communication & Electronic Engineering,
    Royal Melbourne Institute of Technology,
    124 Latrobe St, Melbourne, 3000, Australia
 
ACSnet: rcopm@yabbie             UUCP: ...!siesmo!munnari!yabbie.rmit.oz!rcopm
CSNET:  rcopm@yabbie.rmit.oz     ARPA: rcopm%yabbie.rmit.oz@seismo
BITNET: rcopm%yabbie.rmit.oz@CSNET-RELAY
PHONE:  +61 3 660 2619.
	
	"Views held within are mine, nobody else would be dumb enough to 
	  claim them".
D

rcopm@yabbie.oz (Paul Menon) (05/23/86)

> 
>     (ii)If you are lucky enough to have a MacPlus (grrrr!!), then you can make
> 	full use of the List Manager...

    I received mail from matt%locus.ucla.edu advising me that it may not be
necessary to have the new ROM for the List Manager useable. The List Manager,
being a "package", is not in ROM, thus one should only need the appropriate
system resource.  I can now fully justify my claim (as I did originally) 
of being naive about the List Manager, and also quote a hilighted statement
from MacTutor which demonstrated its use (May '86)...
	
		"...outstanding arcticle with this 
		fine demonstration of a new ROM
		routine...."

Has anyone used the LM with the old ROM?

Gullably yours,


    Paul Menon.

	Dept of Communication & Electronic Engineering,
	Royal Melbourne Institute of Technology,
	124 Latrobe St, Melbourne, 3000, Australia
     
ACSnet: rcopm@yabbie             UUCP: ...!siesmo!munnari!yabbie.rmit.oz!rcopm
CSNET:  rcopm@yabbie.rmit.oz     ARPA: rcopm%yabbie.rmit.oz@seismo
BITNET: rcopm%yabbie.rmit.oz@CSNET-RELAY
PHONE:  +61 3 660 2619.
D