garyo@masscomp.UUCP (Gary Oberbrunner) (05/07/86)
It seems that every time I turn around, I'd like to do some neat little hack having to do with changing the currently active Preferences structure. Like for instance an animated pointer, or one that changes to something else when my window is active, or whatever. Now I know how to get at the one on disk in :s/system-configuration (or wherever it is), and I know how to do GetPrefs(how-much-of-it-I-want); how come there's no equivalent SetPrefs()? Without that it's impossible to do any of the number of nifty things that can be done by dynamically changing Preferences - for instance, I prefer a different set of colors and a different pointer than my roommates. Now wouldn't it be great if we could have TWO system-configuration files, and just load up whichever one we wanted? Makes sense to me. In fact I'd even settle for a crazy roundabout way to get to the address of the REAL Preferences struct - but it seems there's NO WAY to do it! Anyone have any ideas on this topic? How 'bout it, C-A? Can we have SetPrefs()? Would it be so hard? `Imagination is more important - Gary Oberbrunner than knowledge.' - Einstein ...{harvard,allegra}!masscomp!garyo
page@ulowell.UUCP (Bob Page) (05/09/86)
In article <987@masscomp.UUCP> garyo@masscomp.UUCP (Gary Oberbrunner) writes: > How 'bout it, C-A? Can we have SetPrefs()? Would it be so hard? Whoa! Look in your Intuition manual. Towards the back. > >`Imagination is more important - Gary Oberbrunner >than knowledge.' - Einstein ...{harvard,allegra}!masscomp!garyo Yeah, but a little knowledge doesn't hurt either. ..Bob -- UUCP: wanginst!ulowell!page Bob Page ARPA: page@ulowell.CSNET U of Lowell CS Dept VOX: +1 617 452 5000 x2233 Lowell MA 01854 USA
randy@cbmvax.cbm.UUCP (Randy Weiner) (05/09/86)
In article <987@masscomp.UUCP> garyo@masscomp.UUCP (Gary Oberbrunner) writes: >It seems that every time I turn around, I'd like to do some neat little >hack having to do with changing the currently active Preferences >structure. Like for instance an animated pointer, or one that changes >to something else when my window is active, or whatever. > >...how come there's no equivalent SetPrefs()?... >How 'bout it, C-A? Can we >have SetPrefs()? Would it be so hard? > >`Imagination is more important - Gary Oberbrunner >than knowledge.' - Einstein ...{harvard,allegra}!masscomp!garyo How 'bout it Gary. There already IS a SetPrefs function in V1.1. Read the Intuition Manaul, Appendix C. SetPrefs(Preferences, Size, RealThing) where: Preferences -- a pointer to a Preferences structure. Size -- the number of bytes contained in your Preferences structure. Typically, you will use "sizeof(struct Preferences)" for this arg. RealThing -- a Boolean TRUE or FALSE designating whether or not this is an intermediate or final version of the Preferences. The difference is that final changes to Intuition's preferences causes a global broadcast of NEWPREFS events to everyone who's listening for this event. Intermediate change may be used, for instance, to update the screen colors while the user is playing with the color gadgets. Even though it is not listed in the body of the Intuition Manual, it should be accessible through "intuition.library". When opening this library, the revision number must be 31 (this routine was not available under v1.0, i.e. rev30 libs). -- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Randy Weiner -- Commodore Business Machines <<Amiga Technical Support>> uucp: {ihnp4|seismo|caip}!cbmvax!randy arpa: cbmvax!randy@seismo.css.GOV (or) randy@cbmvax.UUCP@{seismo | harvard} TEL: 215-431-9180
barry@amiga.UUCP (Barry Walsh) (05/10/86)
In article <220@cbmvax.cbmvax.cbm.UUCP> randy@cbmvax.UUCP (Randy Weiner) writes: >In article <987@masscomp.UUCP> garyo@masscomp.UUCP (Gary Oberbrunner) writes: >>It seems that every time I turn around, I'd like to do some neat little >>hack having to do with changing the currently active Preferences >>structure. Like for instance an animated pointer, or one that changes >>to something else when my window is active, or whatever. >> >>...how come there's no equivalent SetPrefs()?... >>How 'bout it, C-A? Can we >>have SetPrefs()? Would it be so hard? > How 'bout it Gary. There already IS a SetPrefs function in V1.1. >Read the Intuition Manaul, Appendix C. > The SetPrefs function was intended to be used only by Preferences. The function is used by Preferences to set all of the system defaults. The reason that this function has not been given great publicity is that I don't want application programs to call it without the user requesting the changes.These defaults are provided for the user to set. This function will not let you change a pointer to something else when your window is active.To do that you should look at the SetPointer function in the Intuition Manual. The overhead of the SetPrefs function is very high because it sets all of the defaults every time that you call it.This means that you may not find it to be effective for animating the pointer. If however you feel that you must use it, ALWAYS use GetPrefs to read the data that you are not setting. NEVER call SetPrefs with a size greater than sizeof(struct Preferences). NEVER touch the 'padding' bytes unless you are sure that you know what they are used for. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
acs@amdahl.UUCP (Tony Sumrall) (05/17/86)
In article <987@masscomp.UUCP> garyo@masscomp.UUCP (Gary Oberbrunner) writes: > It seems that every time I turn around, I'd like to do some neat little > hack having to do with changing the currently active Preferences > structure. Like for instance an animated pointer, or one that changes > to something else when my window is active, or whatever. > > ... > > In fact I'd even settle for a crazy roundabout way to get to the > address of the REAL Preferences struct - but it seems there's NO WAY to > do it! Anyone have any ideas on this topic? How 'bout it, C-A? Can we > have SetPrefs()? Would it be so hard? > Seems to me I saw mention of just such a beastie in the RKM. It was only in one place and not really highlighted too well. If I remember, I'll look for it tonight. -- Tony Sumrall ...!{ihnp4,hplabs,seismo,sun}!amdahl!acs [ Opinions expressed herein are the author's and should not be construed to reflect the views of Amdahl Corp. ]