[comp.sys.amiga.tech] Create Port and Simeple refresh problems...

usenet@cps3xx.UUCP (Usenet file owner) (07/19/89)

Simple question for CBM folk: What is the difference between
the CreatPort.c source in the 1.3RKM Vol. 2 and the
CreatePort() in amiga.lib ?
The RKM says "Example only, please use amiga.lib version where possible"
why?

Simple Refresh Windows: I asked this question before but nobody 
answered so here goes again.
I have a program that may open a bunch of SIMPLEREFRESH windows with
text (eventually graphics too) in them. The windows are actually text
viewers, and so they allow the user to scroll them. 
-> Is there a good way to refresh a window after ScrollRaster?? <-
-> Will ScrollRaster be fixed in AmigaOS V2.0? <-

Another simple question: Is it Okay to have more than one boolgadget
pointing to the same Intui(Image|Text|Border) ?

REAL NAME: Joe Porkka   jap@frith.cl.msu.edu

sjorr@rose.waterloo.edu (Stephen Orr) (07/23/89)

In article <3856@cps3xx.UUCP> porkka@frith.UUCP (Joe Porkka) writes:
>Another simple question: Is it Okay to have more than one boolgadget
>pointing to the same Intui(Image|Text|Border) ?
>
>REAL NAME: Joe Porkka   jap@frith.cl.msu.edu

I have a set of simple border structure that are referenced by most of
the booleans in my program with no problems. I can't see how the Amiga
could justify this being a problem, because if the Amiga changes them
(the structures) this would be an operating system with self modifying
code (oh no). My program has be running with no problems since christmas
so I suppose it won't break now (fingers crossed for sure).

If you disagree with this idea then please tell me, I'd hate to be doing
it all wrong...!

					Stephen Orr


{ The opinions expressed herin ARE those of my employer...
		I'm self employed !		- Stephen Orr	}

ml@eceris.ncsu.edu (07/23/89)

In a previous article, porkka@frith.UUCP (Joe Porkka) wrote:
]Another simple question: Is it Okay to have more than one boolgadget
]pointing to the same Intui(Image|Text|Border) ?

          -Yes!-

I suspect that sharing an IntuiImage structure on an AUTOKNOB proportional
gadget might not be a wise thing to do, since Intuition will twiddle this
structure; but I don't swear to this.

cmcmanis%pepper@Sun.COM (Chuck McManis) (07/25/89)

In article <3856@cps3xx.UUCP> porkka@frith.UUCP (Joe Porkka) writes:
>Simple question for CBM folk: What is the difference between
>the CreatPort.c source in the 1.3RKM Vol. 2 and the
>CreatePort() in amiga.lib ?
>The RKM says "Example only, please use amiga.lib version where possible"
>why?

Well I'm not a CBM Folk but can guess why they said that, basically they
are/were the same routine. However in the future, if CreatePort needs
to be changed and you were still using the typed in version you might
not pick up that change. The source was simply a workaround for the bug
that the routine didn't exist in amiga.lib. Now it does, you can use 
it instead.

>Simple Refresh Windows: I asked this question before but nobody 
>answered so here goes again.
>I have a program that may open a bunch of SIMPLEREFRESH windows with
>text (eventually graphics too) in them. The windows are actually text
>viewers, and so they allow the user to scroll them. 
>-> Is there a good way to refresh a window after ScrollRaster?? <-

Define good, and define refresh. I take it to mean that you want to 
scroll the raster and then refresh those bits that didn't move? That
is certainly possible, you just have to program it that way. When 
you get a "refresh" message you should call BeginRefresh(), followed
by the commands to rerender your window, followed by EndRefresh(). That
is the only way to do it. The damage lists insure that you only rewrite
those portions of the window that were damaged. Some improvement has been
promised in the way damage lists are maintained for 1.4.

>-> Will ScrollRaster be fixed in AmigaOS V2.0? <-

What about it is broken? If you mean the "flashing colors" bit when you
try to scroll an n bitplane screen then no, it won't be fixed that I know
of. The problem is with the number of bits you can move in between frames.
To prevent things from changing colors you need to move all bits on all 
bitplanes. If you have a 640 wide screen up with 3 or 4 bitplanes you 
will hardly ever be able to keep up because the blitter just isn't 
fast enough. Alternative ways of scrolling are double buffering the 
screen (expensive in memory) or using the Copper.

>Another simple question: Is it Okay to have more than one boolgadget
>pointing to the same Intui(Image|Text|Border) ?

Yes, since these structures are "read-only" they can be shared by 
several gadgets (and even tasks if you want to get weird). 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"A most excellent barbarian ... Genghis Kahn!"

bryan@geo-works.UUCP (Bryan Ford) (07/30/89)

In article <3856@cps3xx.UUCP> porkka@frith.UUCP (Joe Porkka) writes:
>Another simple question: Is it Okay to have more than one boolgadget
>pointing to the same Intui(Image|Text|Border) ?

In most cases it's fine.  However, don't use the same Image structure for more
than one Prop gadget.  This is because Intuition changes the offsets of the
Image structure to reflect the position of the thumb.  In AUTOKNOB props,
Intuition modifies the entire structure.

I discovered this a while back when I was doing a color requester with 3
sliders (R,G,B).  I tried using the same Image structure for all three.
It's a very interesting effect...you should try it just for fun.  When you
move one of them, all three get internally updated (because they are all in
the same Image structure), but the other two don't get redrawn on the
screen.  So, if you go and click on another propgadget in the same relative
position as you just moved the first one to, you'll get the thumb no matter
where it "seems" to be.  As I said, try it...it's hard to explain.

BTW, if you use custom imagery for your Prop gadgets, you can use the same
ImageData for all of them, just create separate Image structures that point
to the same ImageData.

				Bryan

--

     _______________________________________
   _/   Bryan Ford - bryan@geo-works.uucp   \_
 _/  ..!utah-cs!caeco!i-core!geo-works!bryan  \_
/ ..!uunet!iconsys!caeco!i-core!geo-works!bryan \
\_____________Author: Chroma Paint______________/