Subject: | Possible problem with geometry method. |
Date: | Wed, 18 Jan 2012 23:27:52 +0000 (GMT) |
To: | bug-Tk [...] rt.cpan.org |
From: | Michael Carey <giantsquidmarks [...] mac.com> |
I would like to report two problems with the ->geometry method.
1. The ->geometry method returns incorrect (old?) window position when maximized. To reproduce, run the attached code, Maximize the window, then press "Get Current Geometry". When I do this, the "window position" portion of the geometry string shows the previous window position. The "window size" portion appears to be correct.
2. The ->geometry method returns invalid geometry string when window position contains negative values. To reproduce, run the attached code, move the edge of the window off the upper left side of the screen, click "Get Current Geometry". When I do this, the geometry string shows +-xxx+-yyy. Shouldn't it show -xxx-yyy? The '+' and '-' shouldn't show at the same time should it?
Perhaps something is wrong on my side?
Sample Code:
#!/usr/bin/perl
use Tk;
my $mw = MainWindow->new();
$mw->withdraw();
$mw->title("Show Current Geometry");
my $button = $mw->Button(
-text => 'Get Current Geometry',
-command => \&get_geo,
)->pack(
-expand => 1,
);
my $frame = $mw->Label(
)->pack(
-expand => 1,
);
$mw->deiconify();
$mw->update();
get_geo();
MainLoop();
exit(0);
sub get_geo {
$mw->update();
$frame->configure(-text => 'Geo: ' . $mw->geometry . ' x: ' . $mw->x . ' y: ' . $mw->y);
return(1);
}
__END__
Operating System: Windows XP
PerlTk Version: 804.029 (from activestate repository)
Using: Active State Perl v5.12.4, built for MSWin32-x86-multi-thread
Summary of my perl5 (revision 5 version 12 subversion 4) configuration:
Platform:
osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='c:/MinGW/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields',
optimize='-O2',
cppflags='-DWIN32'
ccversion='', gccversion='4.5.2', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='c:\MinGW\bin\g++.exe', ldflags ='-L"C:\Perl\lib\CORE"'
libpth=\lib
libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -lmsvcrt
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl512.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-mdll -L"C:\Perl\lib\CORE"'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
USE_SITECUSTOMIZE
Locally applied patches:
ActivePerl Build 1205 [294981]
c6fbf28 [perl #71806] perldb does not setup %dbline with the shebang option -d
1fd8fa4 Add Wolfram Humann to AUTHORS
f120055 make string-append on win32 100 times faster
a2a8d15 Define _USE_32BIT_TIME_T for VC6 and VC7
007cfe1 Don't pretend to support really old VC++ compilers
6d8f7c9 Get rid of obsolete PerlCRT.dll support
d956618 Make Term::ReadLine::findConsole fall back to STDIN if /dev/tty can't be opened
321e50c Escape patch strings before embedding them in patchlevel.h
Built under MSWin32
Compiled at Jun 20 2011 18:35:25
@INC:
C:/Perl/site/lib
C:/Perl/lib
.