CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: PERL TKX Troubles....: Edit Log



Jukari
Novice

Oct 28, 2011, 2:55 AM


Views: 3775
PERL TKX Troubles....

Hello,

Very rarely can I not find an answer just by searching google but literally spent the last two days trying to find an answer with no result.

Problem: Need to kill a subroutine, while opening another, or another solution not thought of yet. Basically I want to kill one frame, when opening another.

#!/usr/bin/perl -w

use strict;
use Tkx;
Tkx::package_require("Tktable");
Tkx::package_require("tile");
Tkx::package_require("style");
Tkx::style__use("as", -priority => 70);

our $VERSION = "1.00";
(my $progname = $0) =~ s,.*[\\/],,;





my $mw = Tkx::widget->new(".");
$mw->g_wm_title("Wikiget");
$mw->g_wm_minsize(500, 200);
$mw->configure(-menu => mk_menu($mw));
my $frame1 = $mw->new_frame();
my $frame2 = $mw->new_frame();

Tkx::MainLoop();
exit;
####################################################

sub mk_menu
{
my $mw = shift;
my $menu = $mw->new_menu;

my $file = $menu->new_menu(-tearoff => 0,);
$menu->add_cascade(-label => "File",-underline => 0,-menu => $file,);

$file->add_command(-label => "Frame1",-underline => 1,-command => \&frame1,);
$file->add_command(-label => "Frame2",-underline => 1,-command => \&frame2,);
$file->add_command(-label => "Exit",-underline => 1,-command => [\&Tkx::destroy, $mw],);


return $menu;
}
####################################################################
sub frame1
{
#Closes Frame2

$frame1->g_pack(-side => 'right',-expand => 1,-fill => 'both');
$frame1->configure(-borderwidth => 7, -relief => "sunken");



}

sub frame2
{
#closes Frame1
$frame2->g_pack(-side => 'right',-expand => 1,-fill => 'both');
$frame2->configure(-borderwidth => 7, -relief => "sunken");

}

Thank you.


(This post was edited by Jukari on Oct 28, 2011, 6:21 AM)


Edit Log:
Post edited by Jukari (Novice) on Oct 28, 2011, 6:21 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives