Glade-Perl user options

Glade-Perl gets the user options for a run from disk files and as args to Glade::PerlProject->options().

The options are derived with this precedence (most important first).

  1. Any supplied Glade::PerlGenerate->options() args
  2. Project options file (Project.glade2perl.xml)
  3. User options file (~/.glade2perl.xml)
  4. Site options (/etc/glade2perl.xml)
  5. Glade::PerlGenerate Defaults in package Glade::PerlProject

A list of all the user options and history information available with Glade-Perl-0.49

Some of the options are only meaningful as Glade-Perl run history information but others can be set by the developer to customise the code that is generated.

Your project

author The author's name to appear in generated source code
Default -
  • Dermot Musgrove <dermot.musgrove\@virgin.net>
version Your version number to appear in generated source code
Default - 0.01
  • 0.5.3-pre1
date The date to appear in generated sources
Default - the date/time that this run started
  • Christmas Eve 2001
copying Copying policy to appear in generated source
Default - # Unspecified copying policy, please contact the author\n#
description Project description for About box etc.
Default - 'No description'
  • 'This is a reference form\n that contains all the widgets that Glade knows about'
use_modules newline separated strings containing the perl module that we use()
Default - No modules are use()ed
  • Existing::ProjectmySUBS
allow_gnome Whether or not to generate code for Gnome widgets
Default - get the value from the Glade project file
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef
project_options Filename of options file for this project only This option is only meaningful when set by Glade::PerlGenerate->options() although it is logged in the project_options file itself
Default - Don't read or save options from/to disk file
user_options Filename of options file to read for all projects in this user. This option is only meaningful when set by Glade::PerlGenerate->options() although it is logged in the project_options file
Default - $ENV{'HOME'}/.glade2perl.xml
site_options Filename of options file to read for all projects on this site This option is only meaningful when set by Glade::PerlGenerate->options() although it is logged in the project_options file
Default - /etc/glade2perl.xml

From the Glade file

name Project name to use for file names
Default -
source_directory Where to put the generated files
Default - /Glade/project/directory/src
pixmaps_directory Where to find the pixmaps
Default - /Glade/project/directory/pixmaps

The UI

dont_show_UI Whether to show the UI and wait for the user to close it
Default - Show the UI and wait
glade2perl sets this 0
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef
logo Which image to use as the project logo on about box and messages
Default - Logo.xpm
  • undef will use the glade2perl logo
glade2perl_logo Which image to use as the project logo on about box and messages
Default - glade2perl_logo.xpm
my_perl_gtk The version of Gtk-Perl that we have
Default - Get the version number from Gtk-Perl
  • '0.6123' we have CPAN release 0.6123 (or equivalent)
  • '19990901' we have CVS version of 1st Sep 1999
my_gnome_libs The version of gnome-libs that we have
Default - Get the version number from gnome_libs
  • '1.0.8' we have release 1.0.8 (or equivalent)
  • '19990901' we have CVS version of 1st Sep 1999

Source code

indent Source code indent per Gtk 'nesting'
Default - '    ' (4 spaces)
  • '  '
tabwidth Replace each (eg 8) spaces in the source code with a tab
Default - 8
  • 4
write_source Whether or not to write the source code to a file
Default - don't write source code
glade2perl sets this to 1
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef
style The style of code to generate
Default - 'AUTOLOAD'
  • 'AUTOLOAD' Generate code using OO AUTOLOAD sub
  • 'Libglade' generate libglade code
  • 'Closures' generate code using closures
  • 'Export' generate non-OO code
hierarchy Type of widget hierarchy to generate
Default - 'NONE', Don't generate a widget hierarchy
  • includes 'widget' eg $hier->{'vbox2'}{'table1'}...
  • includes 'class' eg $hier->{'{'GtkVBox'}{'vbox2'} {'GtkTable'}{'table1'}...
  • includes 'both' generates widget and class hierarchies
  • includes 'order' will generate an ordered array of children in either or both widget and/or class hierarchies eg $hier->{'vbox2'}{'table1'}...{'vbox3'}[0]...

Run diagnostics

verbose Level of diagnostics verbosity (0-10)
Default - 2
glade2perl sets this to 0
  • 0 - No diagnostics at all
  • 1 - Main project messages and errors only
  • 2 - also warnings
  • 4
  • 6
  • 8
  • 10 - Absolutely everything - more than you ever wanted :)
log_file File to write diagnostics to
Default - Write to STDOUT
glade2perl sets this to /path/to/glade/file.glade2perl.log
  • /path/to/log/file
diag_wrap Max diagnostic line length (approx)
Default - 0 (no breaks)
  • 0 - Doesn't break the diagnostics messages at all
  • 80 - Wraps diagnostics messages at about 80 characters so that they will fit onto a default screen
diag_file Diagnostics log file name
Default - write any diagnostics to STDOUT
glade2perl sets this to /path/to/glade/file.glade2perl.log
autoflush Whether to flush every output line as it is print()ed. I need this for my editor to catch all the diagnostics if the run fails.
Default - False, only write when blocks full
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef
benchmark
Default - False, don't add time to the diagnostic messages
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef
debug For my testing and debugging.
Default - False
  • True|true|Yes|yes|1 or False|false|No|no|0|''|undef

Run history (internal use only)

glade_proto The Glade definition as a project and a tree of widgets
Default -
glade2perl_version The Glade-Perl version that wrote this file This option is part of the run history and is logged in the project_options file
Default -
glade2perl_logo The Glade-Perl logo pixmap that is used for message boxes and as a default pixmap for your project. This option is part of the run history and is logged in the project_options file
Default -
options_set Who set the options last This option is only meaningful when set by Glade::PerlGenerate->options() although it is logged in the project_options file
Default - 'Default'
  • 'Glade/Build Source'
start_time Time that this run of Glade::PerlGenerate started This option is part of the run history and is logged in the project_options file
Default -

Not supported yet :(


Distribution details

dist_type Type of distribution
Default - tar.gz
dist_compress How to compress the distribution
Default - gzip
dist_scripts Scripts that should be installed
Default - None
dist_docs Documentation that should be included
Default - None

Glade-PerlHelpers

editors Newline separated list of editor calls that we can use
Default - No editor available
active_editor Index of editor that we are using
Default - 0

This is a typical project_options file ~/Devel/Glade-Perl/Reference/Existing/Reference.glade2perl.xml

<G2P-Options>
  <allow_gnome>1</allow_gnome>
  <autoflush>1</autoflush>
  <copying># Unspecified copying policy, please contact the author\n# </copying>
  <debug>1</debug>
  <description>A reference form containing 
all possible Gtk and Gnome widgets</description>
  <diag_wrap>0</diag_wrap>
  <glade2perl_logo>glade2perl_logo.xpm</glade2perl_logo>
  <glade2perl_version>0.49</glade2perl_version>
  <hierarchy>NONE</hierarchy>
  <log_file>Existing/Reference.glade2perl.log</log_file>
  <logo>Logo.xpm</logo>
  <my_perl_gtk>19991107</my_perl_gtk>
  <options_set>Glade/Build Source</options_set>
  <project_options>Existing/Reference.glade2perl.xml</project_options>
  <start_time>Tue Feb 22 17:25:47 GMT 2000</start_time>
  <style>AUTOLOAD</style>
  <tabwidth>8</tabwidth>
  <use_modules>Existing::Reference_mySUBS</use_modules>
  <user_options>/home/dermot/.glade2perl.xml</user_options>
  <verbose>2</verbose>
  <version>0.53</version>
  <write_source>1</write_source>
</G2P-Options>

This what I have in my user_options file ~/.glade2perl.xml

<G2P-Options>
  <author>Dermot Musgrove <dermot.musgrove\@virgin.net></author>
  <diag_wrap>0</diag_wrap>
  <indent>  </indent>
  <tabwidth>4</tabwidth>
</G2P-Options>

This what I have in my site_options file /etc/glade2perl.xml

<G2P-Options>
  <copying># This library is released under the same conditions as Perl, that
# is, either of the following:
#
# a) the GNU General Public License as published by the Free
# Software Foundation; either version 1, or (at your option) any
# later version.
#
# b) the Artistic License.
#
# If you use this library in a commercial enterprise, you are invited,
# but not required, to pay what you feel is a reasonable fee to the
# author </copying>
</G2P-Options>