pavunkumar has asked for the wisdom of the Perl Monks concerning the following question:

I have planned to do the chatting the exercise Perl socket. In this I want to display the require window using Perl Tk . Here my requirement is that the window has to display in the bottom right corner . It is like Gmail Chat window. What I need to for achieve this thing. By default it displays in top left corner.

Thanks in Advance
  • Comment on Perl Tk : Displaying window in bottom right Corner

Replies are listed 'Best First'.
Re: Perl Tk : Displaying window in bottom right Corner
by lamprecht (Friar) on Apr 02, 2010 at 12:09 UTC
    Hi,

    You can use the screenwidth and screenheight methods to get information about the screens geometry. Then use the geometry() method to place your main window.

    see Tk::Widget for documentation.

    Cheers, Christoph
      Use the following code
      use strict; use warnings; use Tk; # Main Window my $mw = MainWindow->new; $mw->geometry('+793+475'); MainLoop;

        On my screen, (1920x1080) your code will put a window almost on the center :)

        Update: I guess your screen resolution is 1024x768 (or 1024x800).

        Regards, Stefan