in reply to Re: Icon generation on the fly
in thread Icon generation on the fly

This app seems to override some Tk methods. Is it possible in your view to create a windowless Toplevel ( I mean with no edges, title bar etc. just a plain widget: say a canvas )?

Replies are listed 'Best First'.
Re^3: Icon generation on the fly
by zentara (Cardinal) on Feb 01, 2012 at 11:07 UTC
    mean with no edges, title bar etc. just a plain widget: say a canvas

    Something like this?

    #!/usr/bin/perl -w use warnings; use strict; use Tk; use Tk::LabEntry; my $mw = MainWindow->new; my $vh = $mw->vrootheight; my $vw = $mw->vrootwidth; # this is what grabs all virtual desktops $mw->overrideredirect(1); # Note that the 'virtual window' height and width are $vh and $vw # respectively, so we use those dimensions for our Canvas height # and width, and let the Canvas expand and fill in both x and y # directions. # my $canvas = $mw->Canvas( -width => $vw, -height => $vh, -background =>'blue', -takefocus =>0 ); # so canvas dosn't take focus on tab press $canvas->pack(-expand => 1, -fill => 'both'); #just for fun instead of an image $canvas->createRectangle(100, 100, 150, 150, -fill => 'orange'); my $window = $canvas->Button(-text=> 'Ok', -command=> sub{ exit;} ); $canvas->createWindow($vw/2, $vh/2, -window=> $window ); MainLoop;

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      Boy, this is cool. It has gray edges (where does this gray come from? the color for window edges and title bars generated for toplevel windows by Win32 is blue on my system) but other than that it is a plain canvas as a Toplevel.