thefinn has asked for the wisdom of the Perl Monks concerning the following question:
I have a bit of perl experience, but am not neat or as efficient as many others (self taught) so sorry or any non-perfect code you might find. Also I've worked on this maybe 10 hours and much of it isn't written as I seem to be stuck at the point where I am trying to create a tab from the menu selection.
I will be putting the propper module headers and such in later (I was testing the implementation of modules when I was doing this for instance). So, once again not much point digressing to "OMG, You aren't using strict?!?!" etc..
Thanks a lot,
Peter.
console.pl starts here:
#!/usr/bin/perl use Tk; use Tk::LabFrame; use Tk::NoteBook; my $Version = "1.0"; sub mainmenu { $main = MainWindow->new(); $main->minsize( qw(640 480)); $main->title( "Rasputin"); $main->configure(-background => 'black'); $menu_bar = $main->Frame(-relief => 'groove', -borderwidth=> 3, -background=> 'black')->pack(-side =>top, -fill +=> 'x', -anchor=>'n'); $scan_menu=$menu_bar->Menubutton(-text => 'Scans', -background => 'black', -foreground => '#00ff00', -activebackground => '#00ff00', -activeforeground => 'black')->pack(-side => 'left'); $bruteforce_menu=$menu_bar->Menubutton(-text => 'Bruteforce', -background => 'black', -foreground => '#00ff00', -activebackground => '#00ff00', -activeforeground => 'black')->pack(-side => 'left'); $search_menu=$menu_bar->Menubutton(-text => 'Searches', -background => 'black', -foreground => '#00FF00', -activebackground => '#00ff00', -activeforeground => 'black')->pack(-side => 'left'); $configuration_menu=$menu_bar->Menubutton(-text => 'Configuration' +, -background => 'black', -foreground => '#00ff00', -activebackground => '#00ff00', -activeforeground => 'black')->pack(-side => 'left'); $help_menu=$menu_bar->Menubutton(-text => 'Help', -background => 'black', -foreground => '#00ff00', -activebackground => '#00ff00', -activeforeground => 'black')->pack(-side => 'right'); $tab_dialog=$main->Frame(-background=> 'black', -relief => 'groove +', -borderwidth=> '3', -foreground => '#00ff00')->pack(-side=> 'bottom', -fill => 'both') +; $tab_dialog->pack(); $tabsinside=$tab_dialog->NoteBook(); $tabsinside->pack(-fill => 'x'); } sub startup { load_modules(); } sub load_modules { foreach $module (<*.module.pl>) { require "$module"; push (@modules_loaded, $module); } } mainmenu(); startup(); MainLoop();
sub begin_menus{ $scan_menu->command(-label => 'Nmap Scan', -background=>'black', -foreground=>'#00ff00', -activebackground=>'#00ff00', -activeforeground=>'black', -command => sub { &nmap_scan_dialog() } ); $search_menu->command(-label => 'Nmap Database Search', -background =>'black', -foreground =>'#00ff00', -activebackground=>'#00ff00', -activeforeground=>'black', -command => sub { &nmap_search_dialog() } ); $configuration_menu->command(-label => 'Nmap Configuration', -background=>'black', -foreground=>'#00ff00', -activebackground=>'#00ff00', -activeforeground=>'black', -command => sub { &nmap_configuration_dialog() } ); } sub nmap_search_dialog { return 1; } sub nmap_scan_dialog { $tabsinside->add("nmap", -label => "Nmap Scan")->pack(); } sub nmap_configuration_dialog { return 1; } sub nmap_start { if ( begin_menus() ) { return 1; } } nmap_start();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk::NoteBook issue with creating tabs under a menu
by zentara (Cardinal) on Jul 15, 2008 at 13:58 UTC | |
by thefinn (Initiate) on Jul 16, 2008 at 06:45 UTC | |
by Anonymous Monk on Jul 16, 2008 at 07:44 UTC | |
|
Re: Tk::NoteBook issue with creating tabs under a menu
by jethro (Monsignor) on Jul 15, 2008 at 14:13 UTC | |
|