Subject: | Improvements for :perlTk operation mode in Tcl::Tk |
The attached patch makes some things more compatible with Perl/Tk:
* "font" and "waitVariable" are now available
* the standard "Message" widget is now available
Only the $top->font("option", "args", ...) form is specified, not the perlish
$top->fontOption("args", ...).
The changes make tkmessage (available at http://ptktools.sourceforge.net)
running both under the Perl/Tk and Tcl::Tk modules.
Regards,
Slaven
#
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -up '/usr/local/dist/cpan/build/TclTk-0.72/Tk.pm' 'TclTk-0.72/Tk.pm'
Index: ./Tk.pm
--- ./Tk.pm Tue Aug 19 21:48:42 2003
+++ ./Tk.pm Fri Mar 12 19:59:58 2004
@@ -277,7 +277,7 @@ my @widgets = qw(frame toplevel label la
widget awidget awidgets
);
my @misc = qw(MainLoop after destroy focus grab lower option place raise
- image
+ image font
selection tk tkbind tkpack grid tkwait update winfo wm);
my @perlTk = qw(MainLoop MainWindow tkinit update);
@@ -417,6 +417,11 @@ sub image {
my ($path) = $int->call("image", @_);
return $int->declare_widget($path);
}
+sub font {
+ my $int = (ref $_[0]?shift:$tkinterp);
+ my ($path) = $int->call("font", @_);
+ return $int->declare_widget($path);
+}
sub scrollbar {
my $int = (ref $_[0]?shift:$tkinterp);
my ($path) = $int->call("scrollbar", @_);
@@ -729,6 +734,14 @@ sub update {
my $self = shift;
$wint{$$self}->update;
}
+sub font {
+ my $self = shift;
+ $wint{$$self}->call('font', @_);
+}
+sub waitVariable {
+ my $self = shift;
+ $wint{$$self}->call('tkwait', 'variable', @_);
+}
#
# some class methods to provide same syntax as perlTk do
@@ -750,6 +763,7 @@ my %ptk2tcltk = (
Canvas => 'canvas',
Label => 'label',
Entry => 'entry',
+ Message => 'message',
Frame => 'frame',
Toplevel => 'toplevel',
NoteBook => 'tixNoteBook',
@@ -764,6 +778,7 @@ my %ptk2tcltk_pref = qw(
Canvas c
Label l
Entry e
+ Message msg
Frame f
Toplevel tl
NoteBook nb
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Fri Mar 12 20:21:08 2004
# Generated by : makepatch 2.00_07*
# Recurse directories : Yes
# Excluded files : (\A|/).*\~\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.BAK\Z
# (\A|/).*\.elc\Z
# (\A|/).*\.exe\Z
# (\A|/).*\.gz\Z
# (\A|/).*\.ln\Z
# (\A|/).*\.o\Z
# (\A|/).*\.obj\Z
# (\A|/).*\.olb\Z
# (\A|/).*\.old\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.so\Z
# (\A|/).*\.Z\Z
# (\A|/)\.del\-.*\Z
# (\A|/)\.make\.state\Z
# (\A|/)\.nse_depinfo\Z
# (\A|/)core\Z
# (\A|/)tags\Z
# (\A|/)TAGS\Z
# p 'Tk.pm' 31423 1079117998 0100775
#### End of ApplyPatch data ####
#### End of Patch kit [created: Fri Mar 12 20:21:08 2004] ####
#### Patch checksum: 90 2771 52462 ####
#### Checksum: 108 3395 38455 ####