Re: [tcltk-perl] Re: Re[2]: Fwd: Re: Tcl and Tcl::Tk
Brought to you by:
hobbs
From: Paul F. <fa...@ca...> - 2004-08-26 20:37:16
|
On Thu, Aug 26, 2004 at 01:21:18PM -0700, Jeff Hobbs wrote: > > [falbe@ca4ad iPaq]$ tautotran.pl > > Tcl error 'bad option "Font": must be cget or configure at > > /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi/Tcl.p > > m line 417. ' while invoking scalar result call: > > ". Font -family Helvetica -size -24" at > > > from > > $largefont = $MW->Font(-family => 'Helvetica', -size => -24); > > Was this legal in Perl/Tk? It's a pretty odd corruption of > the original Tk stuff. You should just do: > > $font = Tcl::Tk::font('create', -family => "Helvetica", -size => -24); yes. From manpage $font = $widget->Font(-option=>value, ...>?) $font = $widget->fontCreate(?fontname??, -option=>value, ...>?) Creates a new font object and returns a reference to it. fontname specifies the name for the font; if it is omitted, then Tk gener- ates a new name of the form fontx, where x is an integer. There may be any number of option-value pairs, which provide the desired attributes for the new named font. See "FONT OPTIONS" below for a list of the possible attributes. > > or less preferred but works: > > $font = $mw->font("create", -family => "Helvetica", -size => -24); This works! > $font = $mw->fontCreate(-family => "Helvetica", -size => -24); Moving on I get errors on this type statement $PREVIOUS_FORM->lower; Where $PREVIOUS_FORM is a Frame created as so: my $newfrm = $Canvases{programs}->Frame(-height => 245); $newfrm->place(-x => 0, -y => 0, -relwidth => 1, -relheight => 1); |