Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 670
  • Last Modified:

How to add browse button in perl

I need a code snippet to add browse button for my perl UI, please let me know where can I find the module, how can I install that module, and if anybody can give me an example it will be really appreciated.

Thanks,

-Ashutosh
0
ashutoshg2006
Asked:
ashutoshg2006
  • 3
  • 2
1 Solution
 
Adam314Commented:
What library are you using for your UI?

If you are using Tk:
my $browsebutton = $mw->Button(-text=>"Browse")->pack();
0
 
ashutoshg2006Author Commented:
Hi Adam,
    Thanks for your reply, please also suggest how do you implement the functionality of browse button, I mean go to the directory and get the file name.

Thanks,

-Ashutosh
0
 
Adam314Commented:
There are several Tk widgets that provide a file select...

use Tk;
use Tk::FBox;
use Tk::FileSelect;

my $mw=new MainWindow;

my $button =$mw->Button(-text=>"Browse with FBox", -command=>sub {$mw->FBox()->Show;})->pack();
my $button2=$mw->Button(-text=>"Browse with FileSelect", -command=>sub {$mw->FileSelect()->Show();})->pack();
my $button3=$mw->Button(-text=>"Browse with getOpenFile", -command=>sub {$mw->getOpenFile();})->pack();

MainLoop();
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
TintinCommented:
Are you using Tk, or are you asking for suggestions as to which UI to use?
0
 
ashutoshg2006Author Commented:
I am using Tk
0
 
Adam314Commented:
The short script I gave will create a window with three buttons.  You can click each button, and you will get a file select box.  Each button uses a different widget to create the file select box.
I'm guessing there are more than the three shown - but those three are part of the standard installation.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now