jimg@hpiacla.HP.COM (Jim Garrison) (01/27/88)
Howdy! I am a novice Amiga and 'C' programmer and I've been having this problem getting Gadgets to work right. I'd really appreciate it if anyone out there could point me in the right direction. I am also having a problem with ASDG's FaccII. Problem #1 -- Gadgets I am trying to use Gadgets to request some information in my program and a couple of the Gadgets I am using need to be Mutually exclusive. So I am setting up the MutualExclude field in my gadgets appropriately (I've used this successfully on Menus before). I set the Flags field to GADGHCOMP | SELECTED on my default Gadget and to just GADGHCOMP on the others. When I run the program, and select one of the other gadgets which should de-select the default gadget, it doesn't work. What happens is I get an IDCMP message that I selected the new Gadget and it becomes highlighted, but the default Gadget is also still highlighted, instead of being de-highlighted. I am wondering does the the MutualExclude field for Gadgets work the same as it does for Menus? I decided to write my own routine which checks the MutualExclude field of the Gadget that was selected, and sets the excluded Gadgets Flags fields to just GADGHCOMP, then it calls RefreshGadget. This causes the same results with the exception that it seems to toggle Gadgets that aren't mutually excluded (their Flags fields haven't been messed with). I know I'm doing something wrong here and if somebody can tell me what or tell me of some Amiga reference that has some useful information about Gadgets, I'd be really grateful for the help. Problem #2 -- ASDG FaccII I'm using a 1000 with 1MB total memory and setting up FaccII with 700 buffers. I compile using Lattice 4.0 and everything works fine for awhile. Then suddenly, after 5-10 successful compiles I get a "Cannot Execute LC2" message and my compile aborts. Repeated attempts yield the same results. The only way I can seem to fix this is to turn off FaccII, then my compiles complete with no problems. Has anyone else seen this problem? Any suggestions? Increasing/decreasing FaccII's buffers doesn't seem to help, rebooting the system does help (for 5-10 more compiles). It doesn't appear that I am running out of memory (still at least 68K left). Thank you, Jim Garrison "I know you think you understand what I said, but what I said was not what I meant!"
eric@hector.UUCP (Eric Lavitsky) (01/30/88)
In article <4830003@hpiacla.HP.COM> jimg@hpiacla.UUCP writes: > >I am trying to use Gadgets to request some information in my program and a >couple of the Gadgets I am using need to be Mutually exclusive. So I am >setting up the MutualExclude field in my gadgets appropriately (I've used Try MxExample on Fish Disk 31... >Problem #2 -- ASDG FaccII > >I'm using a 1000 with 1MB total memory and setting up FaccII with 700 buffers. >I compile using Lattice 4.0 and everything works fine for awhile. Then >suddenly, after 5-10 successful compiles I get a "Cannot Execute LC2" message >and my compile aborts. Repeated attempts yield the same results. The only >way I can seem to fix this is to turn off FaccII, then my compiles complete >with no problems. Has anyone else seen this problem? Any suggestions? >Increasing/decreasing FaccII's buffers doesn't seem to help, rebooting the >system does help (for 5-10 more compiles). It doesn't appear that I am running >out of memory (still at least 68K left). Could be that memory is getting too fragmented to load in the compiler again. Try running 'frags' if you have it when the compiler fails to load and note how big the largest fragment available is. 700 buffers = 350K + ~10K for FaccII + TrackDisk buffers + Workbench code + WorkBench screen = not much left for you buddy. I'd really try using 512 buffers if you only have 1 meg - that'll eat up 256K ... Eric ARPA: eric@topaz.rutgers.edu "Lithium is no longer available UUCP: ...{wherever!}ulysses!eric on credit..." ...{wherever!}rutgers!topaz!eric - from Buckaroo Banzai SNAIL: 34 Maplehurst Ln, Piscataway, NJ 08854
drs-ano@duvan.nada.kth.se (Gunnar Nordmark) (01/30/88)
In article <4830003@hpiacla.HP.COM> jimg@hpiacla.HP.COM (Jim Garrison) writes: >Problem #2 -- ASDG FaccII > >I'm using a 1000 with 1MB total memory and setting up FaccII with 700 buffers. >I compile using Lattice 4.0 and everything works fine for awhile. Then >suddenly, after 5-10 successful compiles I get a "Cannot Execute LC2" message >and my compile aborts. Repeated attempts yield the same results. I have had this problem with lc2 many times. lc2 doesn't load because there isn't a sufficiently large memory chunk left. It needs at least 88K of *continious* memory to load. >It doesn't appear that I am running out of memory (still at least 68K left). All I can say is that if lc2 was divided into small hunks of code that could be loaded into different parts of memory, (like almost every other large program), none of us would have this stupid problem. Personaly I suspect the *reason* that lc2 (and lc1) contain these truly HUGE code hunks is that Lattice want's to press the limits of certain compiler benchmarks. (Programs with few large hunks loads slightly faster than those with many small hunks). I wonder how many microseconds they gained with this approach :-) -- Gunnar Nordmark -- NORDMARK@vaxkab.lne.kth.se
cmcmanis%pepper@Sun.COM (Chuck McManis) (01/30/88)
In article <4830003@hpiacla.HP.COM> jimg@hpiacla.HP.COM (Jim Garrison) writes: >Howdy! > >I am a novice Amiga and 'C' programmer and I've been having this problem >getting Gadgets to work right. I'd really appreciate it if anyone out >there could point me in the right direction. I am also having a problem >with ASDG's FaccII. >Problem #1 -- Gadgets > >I am trying to use Gadgets to request some information in my program and a >couple of the Gadgets I am using need to be Mutually exclusive. Sorry, I can't help with the Facc II problem but Gadgets are something I have played with quite a bit. Basically, mutual exclude does not work for gadgets. It can be made to work fairly simply though, so all is not lost. The technique I use is as follows, in the Gadget structure is a UserData pointer, I point this at other gadgets that are in the same mutual exclude group in a loop so my data structures look like this : +----------+ +----------+ +----------+ +----------+ +-->| Gadget 1 | +-->| Gadget 2 | +-->| Gadget 3 | +-->| Gadget n | | +----------+ | +----------+ | +----------+ | +----------+ | | UserData |--+ | UserData |--+ | UserData |--+ | UserData |--+ | +----------+ +----------+ +----------+ +----------+ | +-----------------------------------------------------------------------+ When you get a IntuiMessage of class GADGETDOWN (or GADGETUP if that is how you are selecting your gadgets) Then you check the UserData pointer to see if it is non-null. If so you loop through looking for the 'other' selected gadget and deselect it. Like so : struct Gadget *TempGad, *CurrentGad; CurrentGad = (struct Gadget *)msg->IAddress; if (!(CurrentGad->UserData)) { for (TempGad = CurrentGad; TempGad != CurrentGad; TempGad = (struct Gadget *)(TempGad->UserData)) if (TempGad->Flags & SELECTED) { TempGad->Flags &= ~SELECTED; RefreshGList(MyWindow,TempGad,1); } } /* Check the parameters to RefreshGList, I don't have an Amiga handy at the moment. */ --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.
cmcmanis%pepper@Sun.COM (Chuck McManis) (02/02/88)
Another good reason to read your own postings is so that you can catch your own bugs! From the gadgets question I included the code ... In article <40497@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes: |> struct Gadget *TempGad, *CurrentGad; |> |> CurrentGad = (struct Gadget *)msg->IAddress; |> if (!(CurrentGad->UserData)) { |> for (TempGad = CurrentGad; TempGad != CurrentGad; |> TempGad = (struct Gadget *)(TempGad->UserData)) |> if (TempGad->Flags & SELECTED) { |> TempGad->Flags &= ~SELECTED; |> RefreshGList(MyWindow,TempGad,1); |> } |> } |> |>/* Check the parameters to RefreshGList, I don't have an Amiga handy at the |> moment. */ And if you will notice the for() loop will never get started! Change it to read for (TempGad = (struct Gadget *)(CurrentGad->UserData); TempGad != CurrentGad; TempGad = (struct Gadget *)(TempGad->UserData)) { And that will fix it right up. --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.
toebes@sas.UUCP (John Toebes) (02/02/88)
In article <280@draken.nada.kth.se>, drs-ano@duvan.nada.kth.se (Gunnar Nordmark) writes: > I have had this problem with lc2 many times. lc2 doesn't load because there > isn't a sufficiently large memory chunk left. It needs at least 88K of > *continious* memory to load. > > All I can say is that if lc2 was divided into small hunks of code that could be > loaded into different parts of memory, (like almost every other large program), > none of us would have this stupid problem. > > Personaly I suspect the *reason* that lc2 (and lc1) contain these truly HUGE > code hunks is that Lattice want's to press the limits of certain compiler > benchmarks. (Programs with few large hunks loads slightly faster than those > with many small hunks). > I wonder how many microseconds they gained with this approach :-) > -- Gunnar Nordmark -- NORDMARK@vaxkab.lne.kth.se :-) Nice try but no cigar :-) There are several reasons that LC2 (and LC1) is loaded as two contiguous chunks. 1) By loading as several separate chunks, memory BECOMES MORE FRAGMENTED whenever you run a compile in the background (think about it). Since many developers tend to do editing while running several compiles (rebuilding a project) it is important that the compiler be able to continuously load. From my tests with Hack (a 180K contiguous chunk) I have been able to load the contiguous version MANY more times than the one broken up into 64K and even 16K chunks. If someone has some real life practical statistics on the Amiga (not theoretical - everyone has that) with multiple programs interacting that prove otherwise I would be happy to see them. Remember that were are dealing with a multi-tasking machine and some programs were intended to be run while others are around. 2) By keeping the code ina single chunk it is significantly smaller as all subroutine calls can be done through 16 bit relative BSrs. Breaking the code into 2 40K chunks adds almost 4K to the in memory image (by increasing the size of all calls from 4 to 6 bytes as well as 8K of relocation overhead. Most people want the compiler to take up less disk space, not more. 3) As for compiler load speed, that is for people to decide. The current compiler loads noticibly faster than the 3.10 version, something that makes a difference when developing a product. It is our intention to produce a quality professional C development environment on the Amiga. /*---------------------All standard Disclaimers apply---------------------*/ /*----Working for but not officially representing SAS or Lattice Inc.-----*/ /*----John A. Toebes, VIII usenet:...!mcnc!rti!sas!toebes-----*/ /*------------------------------------------------------------------------*/