Mark Dootson wrote:

  Hi,

Looking at the source for Font.xs vs your code, your error looks odd indeed and your code correct.

A couple of things:

Your code as written does not work at all, of course. It would have to be

my $size = 12;
$this->{greek_font} = Wx::Font->new( $size, wxMODERN, wxNORMAL, wxBOLD );
Are you quite sure you haven't typed in what you know the code should be, rather than what it actually is?

Is '$size' in your code a Wx::Size object rather than a point size?

  The only two ways I can think of the error below can happen are:
* $size is a Wx::Font object
* wxPerl overloading resolution is horribly broken

that's because before dispatching to that method wxPerl first checks
that the type of the first argument is a Wx::Font object.

If checking out the above does not highlight the problem, what are the versions of Wx and wxWidgets on the failing Linux box and the failing Windows box ?

  That would still be a very useful information.  Also, Keith, could you
double-check that the versions of the program are exactly the same
on all the machines you tried it?

Regard,
Mattia

Keith Brown wrote:


Hi all. First, thanks for the responses to my text control problem last week. All is now well on that front. I do however, have one other problem that is delaying the release of my program.

My wxPerl program runs on my main Linux computer at work and my Linux box at home. It also runs under Windows XP on my laptop (thanks to the text control help). However on another windows machine at home and another Linux computer at work the program fails and I get a message something like:

Usage: Wx::Font::newFont(CLASS, font) at ./wxProdop.pl line 622

Line 622 reads:

$this->{greek_font} = Wx::Font->new( $size, wxModern, wxNormal, wxBold );

As far as I can tell, this is basically the proper way to create a font object so I'm puzzled as to why it should work on some machines but not others. Is there something in the docs that I've missed? Any ideas?


Keith Brown
Department of Chemistry/
Saskatchewan Structural Sciences Center
University of Saskatchewan
Saskatoon, Saskatchewan
306-966-1725
http://chem4823.usask.ca/kbrown.html

-----------------------------------------------------------------------
It is impossible to travel faster than light, and certainly not
desirable, as one's hat keeps blowing off.
                -- Woody Allen
-----------------------------------------------------------------------

Reply via email to