From: | Damir Arh |
Date: | 03 Aug 99 at 08:59:43 |
Subject: | Re: Cycle gadget problem |
From: Damir Arh <damir.arh@guest.arnes.si>
Hello everyone
On 02-Avg-99, Jens Granseuer shared his opinion:
> From: "Jens Granseuer" <jensgr@gmx.net>
> Damir Arh <damir.arh@guest.arnes.si> wrote:
>> I have come accross a very strange problem. I have a few gadtools cycle
>> gadgets in my program and strangely their contents suddenly don't appear
>> centred (they did before, but after some changes in the code - IIRC none
>> directly related to cycle gadgets - they don't any more). I'm really
>> clueless about it. Does anyone have any smart ideas, what could be the
>> reason for it.
>> It certainly is a problem, as although there is enough space for the
>> text, it is written to much to the left and so doen't fit in any more. I
>> guess that for the same reason these gadgets aren't compatible to the
>> CycleToMenu patches and so result in strange effects. I would send in
>> some code, but I don't know which part would be essential.
> Sometimes similar effects are caused if the labels you use are not
> 'stable', i.e. either global or static. In that case you'd probably also
> be generating some Enforcer hits...
> Without any further details that's just a shot into the dark, but that's
> what I thought of.
I guess that shouldn't be a problem. If I just paste out the relevant code.
The labels are declared at the global level:
const char *cy_lab2[]=
{
"Normal","Bold","Shadow","Outline","Outline2",NULL
};
Then the only place where they are used is the creation of the gadgets:
dlg[8]=CreateContext(listagad);
ng.ng_LeftEdge=xsize*30+5;
ng.ng_TopEdge=ysize*2;
ng.ng_GadgetText="Menus";
ng.ng_Width=xsize*13;
gad[11]=CreateGadget(CYCLE_KIND,dlg[8],&ng,GTCY_Labels,(ULONG)
cy_lab2,GTCY_Active, txttype,TAG_END);
and so on for the other cycle gadgets....
Kind regards from Slovenia
Owner of A1200T/030 @ 50MHz, 32MB Fast RAM
and Intel Celeron 300A with 96 MB RAM and ATI Rage Pro AGP 4 MB