Re: question on glade/gtkperl application packaging
- From: Thomas Ledbetter <tledbett revelstone net>
- To: Dermot Musgrove <dermot glade perl connectfree co uk>
- Cc: gtk-perl-list gnome org
- Subject: Re: question on glade/gtkperl application packaging
- Date: Wed, 15 May 2002 23:18:10 -0400
Dermot Musgrove wrote:
Hi Thomas,
Hey! :)
If you edit the run script so that it has a line:
use lib "./";
and set the pixmap directory variable to "./pixmaps" (or whatever you set
pixmaps_directory to):
$Glade::PerlRun::pixmaps_directory = "./pixmaps";
the tarball generated by 'make dist' will run wherever you unpack it and
there is no need to install it at all.
eg.
cd /path/to/tmp/directory/
tar xzf /path/to/YourApp-1.23.tar.gz
cd YourApp-1.23
perl run.pl
The app should find all your pixmaps, modules and data.
'Well.. I was getting things down to just the two .pm files, a file
with all the application code, and then any required pixmaps. I used
this snippet to make the application figure out where things were, no
matter how it was called:
BEGIN
{
my($exec)= $0;
if ( -l $exec ) {
$exec = readlink ($exec);
}
@parts = split (/\//,$exec);
$part = pop (@parts);
$libpath = join ('/',@parts);
}
use lib $libpath;
chdir $libpath;
'And this worked pretty well, with only 'like 5 files for my sample
application.
Then, with help from Chas Owens, I started toying around with the
technique of generating the GUI from .xml, either by a seperate .glade
file or by including it,inline, in the end of a perl script.
This brought things down to the point that the only external files
were pixmaps!!
Now Im trying to include the pixmap in the perl script as well, but
am running into difficulty 'hooking up' a pixmap widget generated from
the xml to the inline pixmap data structure (@xpm_data):
$window = $app->get_widget("window1");
$style = $window->get_style()->bg( 'normal' );
($pixmap,$mask) =
Gtk::Gdk::Pixmap->create_from_xpm_d($window,$style,@xpm_data);
'gives me:
Usage: Gtk::Gdk::Pixmap::create_from_xpm_d(Class, window,
transparent_color, data, ...) at ./revldap line 597.
'like the method wants 4 args - not 3..
My 'goal' in all this was simply to find an equivalent procedure, to
the build process within a C environment to produce a single executable:
You use the linker to combine various .o files, some of which are
generated from C source, some which are from assembly files which simply
have a DATA section to include binary files like images and the like,
and link it all into a single executable - similar to a Java .jar too.
Im pretty close! I just have to figure out the pixmaps thing.
Thanks for the help everybody! :)
--
____________________________________________________________________
Thomas Ledbetter GCS/MU
tledbett revelstone net ULVS++++$
L I N U X
'The apparent randomness with which the universe presents itself,
is proof that it operates on an inherent higher order..'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]