boby_drack has asked for the wisdom of the Perl Monks concerning the following question:
i thought this code ran but definitly not. don't examin the syntax(or my english :) but just if it's possible to change a button's image#!/usr/bin/perl -w use strict ; use Tk ; # window's initialisation $mw = new MainWindow ; $img = 'example.xpm' ; { not really exist sur ! } #A button $bttn = $mw->Button(-image=>$img, -command=>\&clicked)->pack(-side=>'t +op'); sub clicked { if $bttn->configure(-image) eq 'example.xpm') { $bttn->configure(-image=>'example2.xpm'); } else { $bttn->configure(-image=>'example.xpm'); } } MainLoop;
Retitled by Chady -- was 'in perl TK'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How Do I Change A Button Image in Perl TK?
by eserte (Deacon) on Jun 09, 2004 at 12:26 UTC | |
by boby_drack (Acolyte) on Jun 11, 2004 at 00:20 UTC | |
by eserte (Deacon) on Jun 11, 2004 at 09:00 UTC |