Label hotkey not working on some string gadgets

2 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Label hotkey not working on some string gadgets

HI is there some bug/clear diff that with MakeString() label hotkey doesn't work, meanwhile using MakePrefsString() it does?

Code comes from Odyssey mui.cpp/mui.h sources.

and "StringObject" is from MUI's sdk/header "#define StringObject MUI_NewObject(MUIC_String"

  1. ...
  2. APTR MakeString(CONST_STRPTR def, ULONG secret)
  3. {
  4. return StringObject, StringFrame, MUIA_CycleChain, 1, MUIA_String_AdvanceOnCR, TRUE, MUIA_String_Contents, def, MUIA_String_Secret, secret, MUIA_String_MaxLen, 1024, TAG_DONE);
  5. }
  6.  
  7. APTR MakePrefsString(CONST_STRPTR str, CONST_STRPTR def, ULONG maxlen, ULONG id)
  8. {
  9. APTR obj;
  10.  
  11. if ((obj = MUI_MakeObject(MUIO_String, (IPTR)str, maxlen)))
  12. SetAttrs(obj, MUIA_CycleChain, 1, MUIA_String_AdvanceOnCR, TRUE, MUIA_ObjectID, id, MUIA_String_Contents, def, TAG_DONE);
  13.  
  14. return obj;
  15. }
  16. ...
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: Label hotkey not working on some string gadgets

Seems the problem is that the LabelObject and the StringObject aren't "linked"/binded (dunnot how to explain).
Created a new function (clone of one that works):

  1. APTR MakeString2(CONST_STRPTR str, CONST_STRPTR def, ULONG maxlen)
  2. {
  3. APTR obj;
  4.  
  5. if ((obj = MUI_MakeObject(MUIO_String, (IPTR)str, maxlen)))
  6. SetAttrs(obj, MUIA_CycleChain, 1, MUIA_String_AdvanceOnCR, TRUE, MUIA_String_Contents, def, TAG_DONE);
  7.  
  8. return obj;
  9. }

And works fine now.

It was:
Child, MakeLabel(GSI(MSG_URLPREFSGROUP_COOKIE_FILTER)),
Child, st_cookie_filter = (Object *) MakeString(".*", FALSE),

Now I changed to
Child, MakeLabel(GSI(MSG_URLPREFSGROUP_COOKIE_FILTER)),
Child, st_cookie_filter = (Object *) MakeString2(GSI(MSG_URLPREFSGROUP_COOKIE_FILTER), ".*", 1024),

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

Log in or register to post comments