1. wxFont defaults and other wxEuphoria errors
- Posted by ArthurCrump Jul 21, 2013
- 1740 views
Using wxEuphoria version 16 the following two-line program produces an error file, shown below the program, which reveals more than one problem.
include wxeu/wxeud.e constant F = create(wxFont,{12,wxDEFAULT,wxNORMAL,wxNORMAL})
The error file is
C:\euphoria\Site_Lib\wxeu\wxeud.e:6077 in function callProc() call to error_call_back() via routine-id should pass 1 argument, not 19 rid = 9 o = { {105'i',110'n',100'd',101'e',120'x',32' ',111'o',117'u',116't', 32' ',111'o',102'f',32' ',98'b',111'o',117'u',110'n',100'd',115's'}, 5929, 1, 2, 3, 0, 20, C:\euphoria\Site_Lib\wxeu\wxeud.e:6077 in function callProc() A machine-level exception occurred during execution of this statement (signal 5)First problem:
The defaults for the wxFont parameters underline and faceName are invalid and not as documented.
Second problem:
Instead of reporting an invalid argument an attempt is made to report index out of bounds, rather meaningless.
Third problem:
Instead of reporting index out of bounds the error file shows "should pass 1 argument, not 19"
(The string index out of bounds is 19 characters long).
These problems have probably been reported before, but I could not find any reference to them.
Adding ,0,"" to the parameter list produces a sensible result.
Arthur
PS: The machine-level exception did not always appear and I am ignoring that.
2. Re: wxFont defaults and other wxEuphoria errors
- Posted by mattlewis (admin) Jul 21, 2013
- 1737 views
Using wxEuphoria version 16 the following two-line program produces an error file, shown below the program, which reveals more than one problem.
include wxeu/wxeud.e constant F = create(wxFont,{12,wxDEFAULT,wxNORMAL,wxNORMAL})
The documentation is wrong. The only optional parameter is the encoding. In the wxWidgets constructor it defaults to an empty string (at which point ~wxWidgets will choose a face name based on the family), but the wxEuphoria version requires a value.
Matt
3. Re: wxFont defaults and other wxEuphoria errors
- Posted by ArthurCrump Jul 23, 2013
- 1601 views
The documentation is wrong. The only optional parameter is the encoding. In the wxWidgets constructor it defaults to an empty string (at which point ~wxWidgets will choose a face name based on the family), but the wxEuphoria version requires a value.
Matt
That still leaves problem 2 and, more importantly, problem 3.
Instead of showing an error message, the message is passed to a routine which expects something else.