view release on metacpan or search on metacpan
Documentation/Changelog view on Meta::CPAN
- PerlProject->use_Glade_Project() forces a leading '#' for 'copying'.
- PerlSource->perl_preamble() (extra) leading '#' removed from 'copying.
- PerlSource->dist_Makefile_PL() now uses Glade-Perl's min. requirements
as defaults for Makefile.PL version checks for Gtk and Gnome.
- PerlUI->internal_pack_widget() fixed to add() Gnome::IconLists instead
of add_with_viewport() - thanks to René Seindal <rene at seindal.dk>
- PerlUI->new_accelerator() changed to generate code that looks up the
keyval at UI construction time so that apps are more portable.
Also generated code will use Gtk::Gdk->keyval_from_name() in case any
subsequent app user doesn't have a populated Gtk::Keysyms.pm (some RPMs)
- PerlUIExtra->new_GtkPixmapMenuItem() similarly changed.
- PerlUIExtra->new_GnomeEntry() fixed to set history ID correctly.
Thanks to Franco Broi for the bug report.
- PerlSource->perl_AUTOLOAD_top() small change to generated sub AUTOLOAD()
- PerlSource->perl_*_top() now generate modules with initial version
number of 0.10 (was 0.01) to make scripts handling the distribution of
modules more predictable - minor version now always has 2 significant
digits and can be incremented without packing (eg. 0.10 > 0.11).
Also %params now passed through from toplevel script to app_run()
- New user option <source><save_connect_id>1</save_connect_id></source>
and PerlUI->new_signal() changed to generate code that will save all
Documentation/Changelog view on Meta::CPAN
FAQ.i18n - FAQs relating to internationalisation (I18N) issues.
FAQ.old - FAQs relating to old/flawed software versions
- PerlSource->perl_about() generates `gnome-config --version` call in
Gnome about_Form() sub in App/SubApp. If the gnome-libs-devel RPM
is not installed the gnome-libs version number will not be reported.
- PerlSource now generates lines in app_run to load translations.
- Glade-Perl.spec file based on one from George, the mp3 organiser.
This one works I think and allows RPM builds from the tarball by
calling eg. 'rpm -ta Glade-Perl-0.58.tar.gz'.
- PerlUI->new_accelerator() - accelerator key now defaults to ''.
PerlUIExtra->new_GtkPixmapMenuItem() also defaults key to ''
PerlProject->use_Glade_Project() now escapes double quotes in author.
Thanks for bug reports for the above reports to Joe "Markus" Clark.
Fri Oct 20 01:19:45 BST 2000 Dermot Musgrove <dermot.musgrove at virgin.net>
- Version 0.57
- PerlUIGtk->new_GtkPixmap() fixed to use project logo as default rather
than crash in flames if no pixmap is specified.
- PerlUIExtra->new_GnomePixmap() now also uses project logo as default
- PerlUI->Widget_from_Proto() fixed to report missing constructors
and properties correctly rather than die()ing.
- $PerlUI::perl_gtk_depends updated to ignore gnome-db widgets until
Gtk::Perl can handle them.
- PerlRun->full_Path() fixed to remove any /../ parts in the filename
so that the returned full path is exact and unique if possible.
- PerlGenerate pod corrected and improved.
- COPYING file changed to invite commercial users to make a donation to
perl.org (donors at perlmongers.org) rather than me ;-> I borrowed the
COPYING file from a CPAN module and was embarrassed to reread it when
Scott Barninger of Piedmont Airlines accepted the invitation!
- PerlUI->internal_pack_widget() fixed to pack Gtk::PixmapMenuItem
submenus correctly.
- Glade-Perl.spec file borrowed from Gtk-Perl dist to allow RPM builds.
This doesn't work yet - but if you can help ...
- PerlSource amended to also write a method app_run() to ProjectSIGS.pm
and Project.pm (first time) for any user UI initialisation code.
- PerlGUIGtk->new_GtkButton() now caters for 'relief' (in Glade-0.5.10)
- PerlGUIGtk->new_GtkToggleButton() now caters for 'relief' (as above)
- Null source_directory now generates source in project directory (and
not in ./src) to match the actions of Glade 0.5.11.
- New error message if there are minus signs/spaces/dots in signal handler
Documentation/Changelog view on Meta::CPAN
- PerlUI->new_from_child_name() fixed to use gnome_app_docked_item() and
not construct our own widgets and containers (Damon's ideas)
Also now better handles notebooks as children of Gnome Dialogs
- PerlGenerate->unused_elements() name now check_for_unused_elements()
- PerlUI->new_signal() changed 'Missing signal handler' message to
verbose level 4 so that verbose => 2 gives more compact diagnostics.
Skeleton signal handlers are still generated in ProjectSIGS.pm for you
to copy somewhere and edit as before.
- Makefile.PL fixed to use the correct module name (Glade-Perl)
- PerlSource->write_LIBGLADE() fixed to produce working signal handlers.
- PerlUIExtra->new_GtkPixmapMenuItem() changed to use the new bindings in
Gtk-Perl (CVS 20000410) that actually construct a PixmapMenuItem
instead of just a Gtk::MenuItem. Earlier versions of Gtk-Perl will now
construct Gtk::MenuItem explicitly.
- Documentation - all email addresses in online documentation are now
mangled to reduce spam for those kind enough to send bug reports/patches.
Tue Apr 11 15:45:29 BST 2000 Dermot Musgrove <dermot.musgrove at virgin.net>
- Version 0.53
- New FAQ about character encodings.
- PerlProject two new user options to handle character encodings.
<glade_encoding> to specify the Glade file character encoding.
<glade2perl_encoding> to specify the glade2perl.xml project options
file character encoding (defaults to glade_encoding).
- PerlXML->QuoteXMLChars() characters x80-xff not now encoded so project
options are saved without re-encoding eg european characters.
- PerlXML->save_options() extra declaration line with character encoding
eg <?xml version="1.0" encoding="ISO-8859-1"?> written to head of file.
- PerlUIGtk->new_GtkAccelLabel() underlines now parsed correctly.
- PerlUIGtk->new_GtkLabel() underlines now parsed correctly.
- PerlUIGtk->new_GtkButton() underlines now parsed correctly.
- PerlUIGtk->new_GtkCheckButton() underlines now parsed correctly.
- PerlUIGtk->new_GtkRadioButton() underlines now parsed correctly.
- PerlUIGtk->new_GtkToggleButton() underlines now parsed correctly.
- PerlUIGtk->new_GtkCheckMenuItem() underlines now parsed correctly.
- PerlUIGtk->new_GtkMenuItem() underlines now parsed correctly.
- PerlUIGtk->new_GtkRadioMenuItem() underlines now parsed correctly.
- PerlUIExtra->new_GtkPixmapMenuItem() much simplified and underlines
now parsed correctly.
- Perl* all packages now have an empty DESTROY method to keep perl 5.006
happy when it is running cleanup with warnings enabled.
- PerlSource->perl_AUTOLOAD_top, perl_SUBCLASS_top, perl_LIBGLADE_top
amended to write empty DESTROY() subs to generated classes (see above)
- PerlGenerate documentation - perldoc (and manpage) corrected and
improved to include all user options.
Fri Mar 31 16:44:38 BST 2000 Dermot Musgrove <dermot.musgrove at virgin.net>
- Version 0.52
Documentation/FAQ view on Meta::CPAN
This last option might be best, then all glade2perl runs will save the
diagnostics to a file.
4) Edit the project.glade2perl.xml file to specify a line like
<diag>
<verbose>2</verbose>
</diag>
This will generate diagnostics every time that you generate this
project (but no others)
--------------------------------------------------------------------------
Q How do I get the value of a GtkOptionMenu using Glade-Perl?
A One way is to connect a handler to the 'hide' signal of the
GtkOptionMenu's menu and then inspect the widget. eg. in a Gnome project
called 'Reference' with 'optionmenu4' - edit the app_run() method in
Reference.pm and write new on_optionmenu4_hide() to be:
sub app_run {
my ($class) = @_;
$class->load_translations('Reference');
# You can use the line below to load a test .mo file before it is
# installed in the normal place
# (eg /usr/local/share/locale//LC_MESSAGES/Reference.mo)
# $class->load_translations('Reference', 'test', undef,
Documentation/NEWS view on Meta::CPAN
version 0.3.12 does most Gnome stuff now but you will need the CVS version
after 19990922 to get the best from it. I have added a version dependancy
checking so that older versions (eg Gtk-Perl 0.6123) will still work but
without the improvements and newer CVS builds can get at the improvements.
version 0.3.11 handles all widgets/properties that Gtk-Perl 0.6123 can handle
as well as styles, although Glade cannot handle styles properly yet.
Signals are now connected after the widgets are constructed.
version 0.3.8 does more Gnome widgets, GtkImage, MenuItem label accelerator
underlining, signal handlers now get ref to form and first styles (fonts)
version 0.3.5 (and greater) generates Gnome widgets but many are missing in the
generally available Gtk-Perl (0.5121) :-(.
version 0.3.4 produces an OO class for each toplevel window/dialog. Thanks to
Robert Schwebel for many ideas and tests.
version 0.2.0 is the first 'stable' release. Bugfixes only in 0.2.x and
development moves to 0.3.x versions.
Documentation/TODO view on Meta::CPAN
* Spread all pod documentation throughout the files so that they get updated
more regularly (eg user options). Perhaps PerlGenerate and PerlProject
should be combined into PerlGenerate for this reason among others.
The perldoc is still at the end of Glade::PerlGenerate but at least it is
complete and up-to-date.
* Sort out Gnome::App accelerators and signals properly Probably it
would be best to implement the gnome-app-helper methods and use those when
they are available.
* Rewrite GtkMenuItem and PixmapMenuItem constructors to simplify and reuse
code and to handle underline accelerators properly.
* Fix accel key handling so that parse_uline is in generated code so it works
after the string is found with gettext.
* Internationalise every stage but particularly the source code generation
of Gnome::App and Stock stuff
* Change 'single' quoted strings to "double" wherever someone might
enter ' eg tooltips, labels, items, text etc. Perhaps decide at run-time so
Example/Bus/Project.glade view on Meta::CPAN
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
<pack>GTK_PACK_END</pack>
</child>
</widget>
<widget>
<class>GtkMenuBar</class>
<name>menubar2</name>
<tooltip>menubar 'tooltip'</tooltip>
<shadow_type>GTK_SHADOW_OUT</shadow_type>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
<widget>
<class>GtkMenuItem</class>
<name>File</name>
<label>File</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>File_menu</name>
<widget>
<class>GtkMenuItem</class>
<name>New</name>
<tooltip>Create a new BusData file</tooltip>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_N</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_New_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:07 GMT</last_modification_time>
</signal>
<label>New</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Open</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_O</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Open_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:44:29 GMT</last_modification_time>
</signal>
<label>Open...</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Save</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_S</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Save_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:07 GMT</last_modification_time>
</signal>
<label>Save</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Save_As</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_A</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Save_As_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:46:49 GMT</last_modification_time>
</signal>
<label>Save As...</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>separator1</name>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Print</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_P</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Print_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:11 GMT</last_modification_time>
</signal>
<label>Print...</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Mail_to</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_M</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Mail_to_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:13 GMT</last_modification_time>
</signal>
<label>Mail to...</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>separator2</name>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Exit</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_Q</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>destroy_Form</handler>
<last_modification_time>Wed, 24 Mar 1999 01:21:50 GMT</last_modification_time>
</signal>
<label>Exit</label>
<right_justify>False</right_justify>
</widget>
</widget>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Edit</name>
<label>Edit</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenu</class>
<name>Edit_menu</name>
<widget>
<class>GtkMenuItem</class>
<name>Undo</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_Z</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Undo_activate</handler>
<last_modification_time>Sun, 28 Mar 1999 13:15:40 GMT</last_modification_time>
</signal>
<label>Undo</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Cut</name>
<accelerator>
<modifiers>GDK_SHIFT_MASK</modifiers>
<key>GDK_Delete</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Cut_activate</handler>
<last_modification_time>Sun, 28 Mar 1999 13:15:09 GMT</last_modification_time>
</signal>
<label>Cut</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Copy</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_C</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Copy_activate</handler>
<last_modification_time>Sun, 28 Mar 1999 13:15:21 GMT</last_modification_time>
</signal>
<label>Copy</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Paste</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_V</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Paste_activate</handler>
<last_modification_time>Sun, 28 Mar 1999 13:15:35 GMT</last_modification_time>
</signal>
<label>Paste</label>
<right_justify>False</right_justify>
</widget>
</widget>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Options</name>
<label>Options</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Help</name>
<label>Help</label>
<right_justify>True</right_justify>
<widget>
<class>GtkMenu</class>
<name>Help_menu</name>
<widget>
<class>GtkMenuItem</class>
<name>Contents</name>
<accelerator>
<modifiers>0</modifiers>
<key>GDK_F1</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>on_Contents_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:26 GMT</last_modification_time>
</signal>
<label>Contents</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Index</name>
<signal>
<name>activate</name>
<handler>on_Index_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:28 GMT</last_modification_time>
</signal>
<label>Index</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>Search</name>
<signal>
<name>activate</name>
<handler>on_Search_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:28 GMT</last_modification_time>
</signal>
<label>Search</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>separator3</name>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>WWW</name>
<signal>
<name>activate</name>
<handler>on_WWW_activate</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:46 GMT</last_modification_time>
</signal>
<label>WWW</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>About</name>
<accelerator>
<modifiers>GDK_CONTROL_MASK</modifiers>
<key>GDK_F1</key>
<signal>activate</signal>
</accelerator>
<signal>
<name>activate</name>
<handler>about_Form</handler>
<last_modification_time>Wed, 24 Mar 1999 04:45:46 GMT</last_modification_time>
Glade/PerlUI.pm view on Meta::CPAN
'GnomeMessageBox',
'GnomeNumberEntry',
'GnomePaperSelector',
'GnomePixmap',
'GnomePixmapEntry',
'GnomePropertyBox',
'GnomeSpell',
'GtkCalendar', # In Gtk after CVS-19990914
'GtkClock',
'GtkDial',
'GtkPixmapMenuItem',
);
$gnome_db_widgets = join( " ",
'GnomeDbGrid',
'GnomeDbList',
'GnomeDbCombo',
'GnomeDbReport',
'GnomeDbError',
'GnomeDbLogin',
'GnomeDbBrowser',
Glade/PerlUI.pm view on Meta::CPAN
# } else {
# die "\nerror F$me $indent- This is a $child_type type Window".
# " - what should I do?";
# }
$postpone_show = 1;
} else {
# We probably have a parent to pack into somehow
eval "\$refpar = (ref ${current_form}\{'$parentname'})||'UNDEFINED !!';";
unless (eval "exists ${current_form}\{'$parentname'}") {
if ($Glade_Perl->source->quick_gen or 'Gtk::Menu' eq $refwid) {
# We are a popup menu so we don't have a root window
# $class->add_to_UI( $depth, "${first_form}->popup_enable;" );
$class->add_to_UI($depth,
"${current_form}\{'tooltips'} = new Gtk::Tooltips;" );
$class->add_to_UI($depth,
"${current_form}\{'accelgroup'} = new Gtk::AccelGroup;" );
$class->add_to_UI( $depth,
"${current_form}\{'accelgroup'}->attach(\$widgets->{'$childname'} );" );
$postpone_show = 1;
} else {
Glade/PerlUI.pm view on Meta::CPAN
# $Glade_Perl->diag_print(2, $proto);
my $x = $class->use_par($proto, 'x');
my $y = $class->use_par($proto, 'y');
# my $width = $class->use_par($proto, 'width');
# my $height = $class->use_par($proto, 'height');
$class->add_to_UI( $depth,
"${current_form}\{'$parentname'}->put(".
"\$widgets->{'$childname'}, $x, $y);" );
#---------------------------------------
} elsif (' Gtk::MenuBar Gtk::Menu ' =~ m/ $refpar /) {
# We are a menuitem
$class->add_to_UI( $depth,
"${current_form}\{'$parentname'}->append(".
"\$widgets->{'$childname'} );" );
#---------------------------------------
} elsif (' Gtk::MenuItem Gtk::PixmapMenuItem ' =~ m/ $refpar /) {
# We are a menu for a meuitem
$class->add_to_UI( $depth,
"${current_form}\{'$parentname'}->set_submenu(".
"\$widgets->{'$childname'} );" );
$postpone_show = 1;
#---------------------------------------
} elsif (' Gtk::OptionMenu ' =~ m/ $refpar /) {
# We are a menu for an optionmenu
$class->add_to_UI( $depth,
"${current_form}\{'$parentname'}->set_menu(".
"\$widgets->{'$childname'} );" );
$postpone_show = 1;
#---------------------------------------
} elsif (' Gtk::Notebook ' =~ m/ $refpar /) {
$child_type = $class->use_par($proto, 'child_name', $DEFAULT, '' );
if ($child_type eq 'Notebook:tab') {
Glade/PerlUI.pm view on Meta::CPAN
"\$widgets->{'$childname'} );" );
} elsif (' Gnome::Dock ' =~ m/ $refwid /) {
# FIXME why have I commented this out? Is it because Gnome::Dock should not
# be constructed within a Gnome::App - add Gnome::DockItems by using method
# Gnome::App::add_docked() or Gnome::App::add_dock_item() instead?
# $class->add_to_UI( $depth,
# "${current_form}\{'$parentname'}->set_contents(".
# "\$widgets->{'$childname'} );" );
} elsif (' Gtk::MenuBar ' =~ m/ $refwid /) {
$class->add_to_UI( $depth,
"${current_form}\{'$parentname'}->set_menus(".
"\$widgets->{'$childname'} );" );
} else {
$Glade_Perl->diag_print (1,
"error Don't know how to pack %s %s (type '%s') - what should I do?",
$refwid, "${current_form}\{'${childname}'}{'child_name'}", $type);
}
Glade/PerlUIExtra.pm view on Meta::CPAN
$class->add_to_UI( $depth, "\$widgets->{'$name'} = new Gtk::Dial(".
"\$work->{'$name-adj'});" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_view_only($view_only );" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_update_policy('$update_policy' );" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkPixmapMenuItem {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkPixmapMenuItem";
my $name = $proto->{name};
my ($work, $mod);
my $icon = $class->use_par($proto, 'icon', $DEFAULT, '' );
my $stock_item = uc($class->use_par($proto, 'stock_item', $DEFAULT, '' ));
my $stock_icon = $class->use_par($proto, 'stock_icon', $LOOKUP, '' );
my $label = $class->use_par($proto, 'label', $DEFAULT, '' );
my $right_justify = $class->use_par($proto, 'right_justify', $BOOL, 'False' );
# FIXME possibly make this add to a Gnome::UIInfo structure for later use by
# Gnome->create_menus() - see also toolbars
if ($stock_item) {
Glade/PerlUIExtra.pm view on Meta::CPAN
$class->add_to_UI( $depth,
"\$widgets->{'$name'}->add_accelerator(".
"'activate_item', $current_form\{'accelgroup'}, ".
"\$widgets->{'$name-key'}, 'mod1_mask', ".
"['visible', 'locked'] );");
undef $widgets->{"$name-key"};
}
} elsif ($label) {
if ($class->my_gtk_perl_can_do('gtk_pixmap_menu_item')) {
# We can use all the PixmapMenuItem methods
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new Gtk::PixmapMenuItem;" );
$class->add_to_UI( $depth, "\$widgets->{'$name-label'} = ".
"new Gtk::AccelLabel(_('$label'));" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->add(".
"\$widgets->{'$name-label'});" );
$class->add_to_UI( $depth, "\$widgets->{'$name-label'}->".
"set_alignment(0.0, 0.5);" );
$class->add_to_UI( $depth, "\$widgets->{'$name-label'}->show;" );
if (_($label) =~ /_/) {
$class->add_to_UI( $depth,
Glade/PerlUIExtra.pm view on Meta::CPAN
$class->add_to_UI( $depth,
"\$widgets->{'$name'}->add_accelerator(".
"'activate', $current_form\{'accelgroup'}, ".
"\$widgets->{'$name-key'}, 'mod1_mask', ".
"['visible', 'locked'] );");
undef $widgets->{"$name-key"};
}
undef $widgets->{"$name-label"};
} else {
# Use old methods (from Gtk::MenuItem)
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new Gtk::MenuItem(_('$label') );" );
if (_($label) =~ /_/) {
$class->add_to_UI( $depth,
"\$widgets->{'$name-key'} = ".
"\$widgets->{'$name'}->child->parse_uline(_('$label') );");
$class->add_to_UI( $depth,
"\$widgets->{'$name'}->add_accelerator(".
"'activate', $current_form\{'accelgroup'}, ".
"\$widgets->{'$name-key'}, 'mod1_mask', ".
"['visible', 'locked'] );");
undef $widgets->{"$name-key"};
}
}
} else {
# There is no label
$class->add_to_UI($depth, "\$widgets->{'$name'} = ".
"new Gtk::PixmapMenuItem;" );
}
if ($right_justify) {
$class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
}
$class->pack_widget($parent, $name, $proto, $depth );
if ($icon) {
if ($class->my_gtk_perl_can_do('gtk_pixmap_menu_item')) {
$class->add_to_UI( $depth,
"$current_form\{'$name-pixmap'} = \$class->create_pixmap(".
Glade/PerlUIGtk.pm view on Meta::CPAN
"$current_form\{'$name'}->child->parse_uline(_('$label') );");
$class->add_to_UI( $depth,
"$current_form\{'$name'}->add_accelerator(".
"'clicked', $current_form\{'accelgroup'}, ".
"$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
undef $widgets->{"$name-key"};
}
return $widgets->{$name};
}
sub new_GtkCheckMenuItem {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkCheckMenuItem";
my $name = $proto->{'name'};
my $label = $class->use_par($proto, 'label', $DEFAULT, '' );
my $active = $class->use_par($proto, 'active', $BOOL, 'False' );
my $always_show_toggle= $class->use_par($proto, 'always_show_toggle', $BOOL, 'False' );
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new_with_label Gtk::CheckMenuItem(_('$label'));" );
if ($class->use_par($proto, 'right_justify', $BOOL, 'False' )) {
$class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
}
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_state($active );" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_show_toggle($always_show_toggle );" );
$class->pack_widget($parent, $name, $proto, $depth );
if (_($label) =~ /_/) {
$class->add_to_UI( $depth,
Glade/PerlUIGtk.pm view on Meta::CPAN
my $selection_mode = $class->use_par($proto, 'selection_mode', $LOOKUP, 'single' );
$class->add_to_UI( $depth, "\$widgets->{'$name'} = new Gtk::List;" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_selection_mode(".
"'$selection_mode' );" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkMenu {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkMenu";
my $name = $proto->{'name'};
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Menu;" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkMenuBar {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkMenuBar";
my $name = $proto->{'name'};
my $shadow_type = $class->use_par($proto, 'shadow_type', $LOOKUP, 'out' );
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuBar;" );
$shadow_type &&
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_shadow_type(".
"'$shadow_type' );" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkMenuFactory {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkMenuFactory";
my $name = $proto->{'name'};
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuFactory("." );" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkMenuItem {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkMenuItem";
my $name = $proto->{'name'};
my $label = $class->use_par($proto, 'label', $DEFAULT, '' );
my $right_justify = $class->use_par($proto, 'right_justify', $BOOL, 'False' );
if ($proto->{'stock_item'}) {
# FIXME - this is a Gnome stock menu item and should be in UIExtra
# FIXME convert this to do a proper lookup (maybe with new sub)
my $stock_item = $class->use_par($proto, 'stock_item', $DEFAULT, '' );
$stock_item =~ s/GNOMEUIINFO_MENU_(.*)_TREE/$1/;
# FIXME this creates the string - we should look it up instead
$stock_item = ucfirst(lc($stock_item));
# FIXME this only does uline for first character wrong, wrong, wrong
$label = "_".$stock_item;
# $stock_item = $Glade::PerlUIExtra::gnome_enums->{"GNOME_STOCK_PIXMAP_$stock_item"};
# $class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
# "Gnome::Stock->menu_item('$stock_item', '$stock_item');" );
}
if ($label) {
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuItem(".
"_('$label'));" );
} else {
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuItem;" );
}
if ($right_justify) {
$class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
}
$class->pack_widget($parent, $name, $proto, $depth );
if (_($label) =~ /_/) {
$class->add_to_UI( $depth,
"$current_form\{'$name-key'} = ".
"$current_form\{'$name'}->child->parse_uline(_('$label') );");
$class->add_to_UI( $depth,
Glade/PerlUIGtk.pm view on Meta::CPAN
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkObject";
my $name = $proto->{'name'};
$class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Object;" );
$class->pack_widget($parent, $name, $proto, $depth );
return $widgets->{$name};
}
sub new_GtkOptionMenu {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkOptionMenu";
my $name = $proto->{'name'};
my $item;
my @items;
my $count = 0;
my $items = $class->use_par($proto, 'items' );
my $initial_choice = $class->use_par($proto, 'initial_choice', $DEFAULT, 0 );
$class->add_to_UI( $depth, "\$widgets->{'$name'} = new Gtk::OptionMenu;" );
$class->pack_widget($parent, $name, $proto, $depth );
$class->add_to_UI( $depth, "\$widgets->{'${name}_menu'} = new Gtk::Menu;" );
$class->pack_widget("$name", "${name}_menu", $proto, $depth );
if (defined $items) {
@items = split(/\n/, $items );
foreach $item (@items) {
if ($item) {
$class->add_to_UI( $depth, "\$widgets->{'${name}_item$count'} = ".
"new Gtk::MenuItem('$item' );" );
$class->pack_widget("${name}_menu", "${name}_item$count", $proto, $depth+1 );
if ($count == $initial_choice) {
$class->add_to_UI( $depth,
"${current_form}\{'${name}_item$count'}\->activate;" );
}
$count++;
}
}
$class->add_to_UI( $depth,
"${current_form}\{'$name'}->set_history( $initial_choice );" );
Glade/PerlUIGtk.pm view on Meta::CPAN
}
$class->add_to_UI( $depth, "$current_form\{'$name'}->set_mode(".
"$draw_indicator );" );
$class->add_to_UI( $depth, "$current_form\{'$name'}->set_state(".
"$active );" );
return $widgets->{$name};
}
sub new_GtkRadioMenuItem {
my ($class, $parent, $proto, $depth) = @_;
my $me = "$class->new_GtkRadioMenuItem";
my $name = $proto->{'name'};
my $label = $class->use_par($proto, 'label', $DEFAULT, '' );
my $right_justify = $class->use_par($proto, 'right_justify', $BOOL, 'False' );
my $active = $class->use_par($proto, 'active', $BOOL, 'False' );
my $always_show_toggle = $class->use_par($proto, 'always_show_toggle', $BOOL, 'True' );
my $group = $class->use_par($proto, 'group', $DEFAULT, '' );
my $rmi_group = "$current_form\{'rmi-group-$group'}";
if ($group) {
if (eval "defined $rmi_group") {
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new Gtk::RadioMenuItem(_('$label'), $rmi_group );" );
} else {
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new Gtk::RadioMenuItem(_('$label') );" );
}
$class->add_to_UI( $depth, "$rmi_group = \$widgets->{'$name'};" );
} else {
$class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
"new Gtk::RadioMenuItem(_('$label') );" );
}
if ($right_justify) {
$class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
}
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_state(".
"$active );" );
$class->add_to_UI( $depth, "\$widgets->{'$name'}->set_show_toggle(".
"$always_show_toggle );" );