Dlg.icon works only when assigned twice

Why does a single call to Dlg.icon fail to set the question icon in this example, but doing it twice works?

function vodooguiConfirm(icon) {
  var Dlg = DOpus.Dlg; Dlg.template = "✓✗Confirm";
  Dlg.Create(); // create detached
  // 1 fails
  //Dlg.icon ="question";
  // 2 works
  Dlg.icon ="question";
  Dlg.icon ="question";
  var result = Dlg.RunDlg();
}
function OnClick(cmdD) {
 var aaa = vodooguiConfirm();
}

Test.dcf (2.4 KB)

One Dlg.icon will be enough when you set it before you call Dlg.Create().

Admittedly, this doesn't answer your question :wink:

1 Like

ironic :slight_smile: the .create was added to avoid other errors (I guess, caused by the lack of this initialized object)

Needing to set it twice if it's set after dialog creation was a bug. We've coded a fix for it which will be included in Opus 13.5.1.