LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2002, 08:23 AM   #1
da Perp
Member
 
Registered: Oct 2001
Location: the Netherlands
Distribution: Bear Linux (LFS 3.3)
Posts: 171

Rep: Reputation: 30
Perl & GUI


I want to develop gui's using perl. Anybody know what program I can use to develop GUI's and then export calls to script them in perl? I've played around with glade, but I dont really know how to run compiled programs so im looking for an easier alternative...
 
Old 01-22-2002, 08:32 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
an easier alternative to glade? glade is extremely easy to build GUI's with. it's only for gtk tho, so if you want to build GUI's with Tcl, QT or somethign, then you'll need to program them by hand.

to compile a glade GUI, go to the project directory and type ./automake.sh normally. not sure if that works for Perl too tho...
 
Old 01-22-2002, 08:53 AM   #3
da Perp
Member
 
Registered: Oct 2001
Location: the Netherlands
Distribution: Bear Linux (LFS 3.3)
Posts: 171

Original Poster
Rep: Reputation: 30
yeah i know glade isnt hard, but i dont really know how to make the buttons and stuff actuially do something using perl...is there maybe a man page i can read about htis?
 
Old 01-22-2002, 09:35 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well, that's not the GUI. Glade can only go so far as emitting signals and connectnig them to a callback function, but you have to write all these functions yourself to actually amke it do something useful. i've not got into perl yet tho, and i only know abuot gtk signls in c and c++. you'll want to look at GtkPerl documentation for examples and such
 
Old 01-27-2002, 03:37 PM   #5
gene_gEnie
Member
 
Registered: Aug 2001
Location: London UK
Distribution: Redhat 7.2, soon to be LFS!
Posts: 42

Rep: Reputation: 15
the GtkPerl tutorial is pretty helpful. Although still sadly lacking in some areas i reckon. Im just starting out as well using Gtk/Perl to create a GUI for something.

Im not using Glade, just coding Gtk by hand. Its really straightforward. One of the best lang's i've picked up.

Do you know any perl?

anyway, here is an example of creating a button, connecting it to signal and a sub routine to actually do something with it.

# Create the buttons and add them to the hbox which ive declared here also and added to a vbox which ive declared earlier and added to a window (which ive declared earlier and ... :-)
$hbox2 = new Gtk::HBox( $false, 0 );
$vbox->pack_start( $hbox2, $false, $true, 0 );
$hbox2->show();

$button_create = new Gtk::Button( "Create Filter" ); #create button
$hbox2->pack_start( $button_create, $true, $true, 0 ); #add it to hbox

# Connect our callbacks to the create button
$button_create->signal_connect( "clicked", \&button_create_clicked ); #signal is clicked, #sub im gonna call is button_create_clicked
$button_create->show();


... snipped


sub button_create_clicked {

open (MYFILE, ">testfil");
print MYFILE "#Exim filter\n\n";
close (MYFILE);

open (XMLFILE, "+<struct.xml")
or die ( "error" );
my $parser = new XML:OM::Parser;
my $document = $parser->parse( \*XMLFILE );

pop_file ( $document );

...snipped

etc etc

hope that helps

Martin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl GUI in Linux!!! baby_linu Linux - Newbie 3 04-30-2009 12:48 PM
[SOLVED] Bad font in GUI & Konkerer-OK in Moz & others sundry_50 Linux - Newbie 2 02-06-2005 06:16 AM
Hiding code in PERL, perl gui question randomx Programming 1 06-26-2004 03:22 PM
how to uninstall lilo & install grub without using gui & linuxconf? prav_284 Red Hat 1 11-28-2003 05:45 AM
perl compiler & gui builder hardigunawan Linux - General 1 07-18-2002 09:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration