Hi,
When using a requester that has tag REQ_TimeOutSecs defined (with a value > 0) and subsequently the requester DOES time out, what is then the return value of the method? Do I correctly assume this to be 0? Or?
void VARARGS68K MessageBox(struct ExecParam *xn, ...)
{
INFO_ENTER
va_list ap;
va_startlinear(ap, xn);
IExec->RawDoFmt((__RD)->rd_FormatText, va_getlinearva(ap, void*), NULL, (__RD)->rd_BodyText);
va_end(ap);
struct TagItem ReqTags[] = {{REQ_Type , (__RD)->rd_Type}
,{REQ_TitleText , (uint32)(__RD)->rd_TitleText}
,{REQ_GadgetText , ( (__RD)->rd_GadgetText) ? ((uint32)(__RD)->rd_GadgetText)
: ((uint32) INFO_GADGETTEXT)}
,{REQ_BodyText , (uint32)(__RD)->rd_BodyText}
,{REQ_TimeOutSecs, (uint32)(__RD)->rd_TimeOut}
,{REQ_Image , (uint32)(__RD)->rd_Image}
,{TAG_END , (uint32)0}
};
struct orRequest ReqMsg = {RM_OPENREQ, ReqTags, (__RD)->rd_Window, (__RD)->rd_Screen};
if (rd->rd_WinObj != NULL)
{
IIntuition->SetAttrs(*(__RD)->rd_WinObj, WA_BusyPointer, TRUE, TAG_END);
(__RD)->rd_Response = IIntuition->IDoMethodA((__RD)->rd_ReqObj, (APTR)&ReqMsg);
IIntuition->SetAttrs(*(__RD)->rd_WinObj, WA_BusyPointer, FALSE, TAG_END);
}
else
{
(__RD)->rd_Response = IIntuition->IDoMethodA((__RD)->rd_ReqObj, (APTR)&ReqMsg);
}
INFO_VACATE
}
And now that I'm at it, how would tag 'Req_VarArgs' fit in here? Would this cut that cake?
void VARARGS68K MessageBox(struct ExecParam *xn, ...)
{
INFO_ENTER
va_list ap;
va_startlinear(ap, xn);
va_end(ap);
struct TagItem ReqTags[] = {{REQ_Type , (__RD)->rd_Type}
,{REQ_TitleText , (uint32)(__RD)->rd_TitleText}
,{REQ_GadgetText , ( (__RD)->rd_GadgetText) ? ((uint32)(__RD)->rd_GadgetText)
: ((uint32) INFO_GADGETTEXT)}
,{REQ_VarArgs , (uint32)va_getlinearva(ap, void*)}
,{REQ_BodyText , (uint32)(__RD)->rd_FormatText}
,{REQ_TimeOutSecs, (uint32)(__RD)->rd_TimeOut}
,{REQ_Image , (uint32)(__RD)->rd_Image}
,{TAG_END , (uint32)0}
};
struct orRequest ReqMsg = {RM_OPENREQ, ReqTags, (__RD)->rd_Window, (__RD)->rd_Screen};
if (rd->rd_WinObj != NULL)
{
IIntuition->SetAttrs(*(__RD)->rd_WinObj, WA_BusyPointer, TRUE, TAG_END);
(__RD)->rd_Response = IIntuition->IDoMethodA((__RD)->rd_ReqObj, (APTR)&ReqMsg);
IIntuition->SetAttrs(*(__RD)->rd_WinObj, WA_BusyPointer, FALSE, TAG_END);
}
else
{
(__RD)->rd_Response = IIntuition->IDoMethodA((__RD)->rd_ReqObj, (APTR)&ReqMsg);
}
INFO_VACATE
}
And then, whilst going through 'classes/requester.h', I encountered that very sexy sounding tag 'REQ_StayOnTop'. I'll try and see how that one can be fitted in.
OldFart

 
  
I can't help with REQ_VarArgs, as I've never played with that. But for the timeout, the autodoc says:
@msteed
I missed that one. Thanks!
OldFart
I am quite sure that every reference to ap is illegal after va_end(ap) and also the result of va_getlinearva becomes invalid after va_end. So you have to move va_end to the end of your function, at least after DoMethod.
@thomas
Sounds (and seems) logical. Thanks.
OldFart
@OldFart
for the REQ_VarArgs, you can take a look in playcdda_gui.c (os4depot)
http://www.os4depot.net/share/audio/play/playcdda_gui.lha
or this one:
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P
@Jabirulo
Thanks!
OldFart
@OldFart
LOL. Also, if you are also to target DOS 51.12+, then you can use TimedDosRequester(). Which provides a similar but simpler function to display a similar requester.