Reaction - Change the content of string.gadget dynamically ?

4 posts / 0 new
Last post
Seventhwonder
Seventhwonder's picture
Offline
Last seen: 3 years 2 days ago
Joined: 2018-12-26 13:50
Reaction - Change the content of string.gadget dynamically ?

Hi

Let's say we have a gadget like following:

if((gb_StringGad = (struct Gadget *) IIntuition->NewObject(IString->STRING_GetClass(),NULL,
GA_ID, GAD_ID_String,
GA_RelVerify, TRUE,
GA_TabCycle, TRUE,
STRINGA_MaxChars, 6,
STRINGA_MinVisible, 6,
STRINGA_TextVal, pcbtempstring,
TAG_DONE)))

How can I change some attributes (e.g. text value)

IIntuition->SetGadgetAttrs(gb_StringGad, gb_WindowObj,STRINGA_TextVal, "changed");

Above code doesn't work ?

cwenzel
cwenzel's picture
Offline
Last seen: 2 weeks 2 days ago
Joined: 2021-01-12 07:05
Re: Reaction - Change the content of string.gadget dynamically ?
  1. uint32 result = SetGadgetAttrs(
  2. struct Gadget *gad,
  3. struct Window *win,
  4. struct Requester *req,
  5. Tag tag1, ...);

You are missing the 'req' argument slot.
And you are missing a TAG_END.

jabirulo
jabirulo's picture
Offline
Last seen: 17 hours 24 min ago
Joined: 2013-05-30 00:53
Re: Reaction - Change the content of string.gadget dynamically ?

..and "gb_WindowObj" should be a "struct Window *" not an object.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

cwenzel
cwenzel's picture
Offline
Last seen: 2 weeks 2 days ago
Joined: 2021-01-12 07:05
Re: Reaction - Change the content of string.gadget dynamically ?

Good catch, I missed that one.

Log in or register to post comments