#59 UserDialog~createCenter's "expected" defaults to 20

Windows
closed
Mark Miesfeld
ooDialog (6)
5
2012-08-14
2012-03-05
DougL
No

OODialog's .UserDialog~createCenter's "expected" argument is documented (in ~create) as defaulting to 200; however, when I default it and try to add more than 20 button, entry, and checkbox widgets it tends to cause OODialog to blow. If I explictly specify "expected" as 200, all is well.

My guess is that the table is allocated with 20 elements but accessed as if it had 200.

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2012-03-05

    Doug,

    I would like to know what version of ooRexx you are using, and see your code. It's possible that you have the arguments wrong, too many commas.

    --
    Mark Miesfeld

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-03-05

    Hi Doug,

    I'm attaching a test program you can try. By default it creates 22 button, edit, and check box controls. You can edit the defineDialog method to creat 32 and 42 controls by uncommenting some code sections.

    I've run it on ooRexx 3.2.0, 4.0.0, 4.0.1, 4.1.0, 4.1.1, and the unreleased 4.2.0 without any problem for 22 through 42 controls.

    It's most likely that you have an error in your code. If you post your code here, I can probably tell you what the error is.

    --
    Mark Miesfeld

     
  • DougL
    DougL
    2012-03-05

    Thanks for the responses, Mark, and the good guess about the number of arguments.

    It turns out that OODialog's only problem is that when createCenter is called with expected=='', it blows up Rexx ("Open Object Rexx Interface has stopped working") instead of issuing some type of Rexx error.

    My number-of-arguments problem was due to copying a call to "createCenter" from one to "create". I'd erroneously interpreted the createCenter documentation's "See Create for a description of all arguments and an example" to mean the arguments are the same.

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-03-05

    Hi Doug,

    Both of the problems you list are fixed in ooDialog 4.2.0, which will be the next release of ooDialog.

    The worst problem, the crash, is fixed by raising an error condition if adding a control will go past allocated memory.

    The second problem, mis-interpreting the doc, is, hopefully, fixed by better documentation. There were a number of places in the doc that said something similar to "see xx for the arguments." I've tried to replace all those places by documenting each method completely.

    You can try a beta of the new ooDialog by down loading it from SourceForge:

    http://sourceforge.net/projects/oorexx/files/ooDialog/

    The beta comes using a technology curretnly called: switchOODialog. Switch ooDialog allows you to switch back and forth between ooDialog 4.2.0 and ooDialog 4.1.0 in your installed ooRexx. If you have a 4.1.0 ooRexx installation, you can download and install the beta. Once you do that you can 'switch' between ooDialog 4.1.0 and the beta ooDialog 4.2.0 by just running a command. You can switch back and forth as often as you want.

    This allows you try / test the beta with no risk because you can easily switch back to the release version of ooDialog whenever you want.

    --
    Mark Miesfeld

     


Anonymous


Cancel   Add attachments