This is the Frequently Asked Question list for Glade-Perl source generator
--------------------------------------------------------------------------
Q   Glade-Perl fails with this message:
    FAILED with Eval error 'Can't locate object method "button" via
        package "Gnome::Stock" at (eval 373) line 1.

A   The error means that Gnome wasn't available. There is a bug in version 
    <= 0.42 so that the <allow_gnome> project option was not saved. 
    Either add/amend the line in file projectname.glade2perl.xml to read:
        <allow_gnome>1</allow_gnome>
        
    or, better, upgrade to 0.42. 
    
--------------------------------------------------------------------------
Q   How do I write signal handlers in a separate module?

A   As always with Perl, there is more than one way to do it.
    1) The first way is to put your signal handlers in a .pm module and use() 
    the module from the generated source code. An example of this is the file
    '$DIST_DIR/Example/BusForm_mySUBS.pm. You then specify this module to 
    Glade-Perl with the user option 'use_module' which you can check in the
    distributed script $DIST_DIR/test.pl. This is not the best approach as you
    have to make sure that you Export the signal_handler names if they are to
    run when you cause the signal.

    2) The better and simpler way is to subclass the generated UI module and put 
    the signal handlers there. An example of this is $DIST_DIR/Example/SubBus.pm.
    Version 0.41 of Glade-Perl generates a subclass with a skeleton signal 
    handler for each signal handler that is needed. This is an OO approach.
    You can then copy this subclass somewhere and edit the signal handlers to do
    whatever you want. The advantage of this approach is that you can generate 
    the UI again and again without changing the subclass except for adding or
    removing new signal handlers.

--------------------------------------------------------------------------
Q   How do I access widgets to set or get their data/text?

A   Each instance of a form (you can have more than one copy of a UI showing at
    the same time) stores a complete hash of its widgets in a global anonymous
    hash (actually defined as $Glade::PerlRun::all_forms) that you can access
    from your signal handler. One way to get at an entry widget in a signal
    handler is to look up the widget in this hash.

    The AUTOLOAD()ed signal handler message box shows all the args that would be
    passed to the relevant signal handler but something like this should work:

      sub my_signal_handler {
        my ($class, $data, $object, $instance) = @ARG;
        my $form = $__PACKAGE__::all_forms->{$instance};
        my $entry_val = $form->{'entry_widget_name'}->get_text;
        ...
     }

    This is for the case where the entry widget is on the same form as the 
    widget that causes the signal. In other cases you will have to store the 
    $instance value in a global or pass it as an arg somehow.
--------------------------------------------------------------------------
Q   My GtkClock does not show the current time

A   Older versions of gnome-libs (at least <= 1.0.8) do not handle the clock 
    type 'realtime' properly. Gtk-Perl 0.6123 cannot explicitly set the type 
    so we are stuck. Upgrade to a newer version of gnome-libs.

        
--------------------------------------------------------------------------
Q   When I upgraded to Glade-Perl version 0.3.5 (or greater) I get error ...
    'Can't locate Gtk/Keysyms.pm in @INC (@INC contains: .....'
    
A   You have a flawed version of Gtk-Perl - eg released version 0.5121. There
    are many improvements in later versions (or in gnome.org CVS repository),
    for example, Glade-Perl now uses the new keysyms bindings in Gtk::Keysysms.
    Version 0.6123 is now available on CPAN (20 Aug 1999), otherwise you can
    get the CVS version ie. the 'gnome-perl' module in the CVS repository at 
    gnome.org and use that. There is a good description of the Gnome CVS on a
    Gnome mirror at http://www.uk.gnome.org/devel/whatiscvs.shtml
    
    If neither action is possible or desirable you can edit Glade::PerlUI.pm 
    in two places.
    
    change two lines in the Glade/PerlUI.pm module and 'make install' again

    #   use Gtk::Keysyms;               # comment out line 23 (or near)
    #   $self = $Gtk::Keysyms{$self};   # replace line 1590 (or near) 
                                        # by the line below
        $self = ord ($self );

    Of course, any keyboard accelerators that use keysyms other than A-Z,a-z
    will cause unusual behaviour but it should get you going.
    
--------------------------------------------------------------------------
Q   When I run glade2perl I get the following message ...
    Can't call method "merge_options" on an undefined value at
    /home/Perl/5.005_02/lib/site_perl/Glade/PerlProject.pm line 210.
    
A   Two people have reported this error, they use perl version 5.005_x with 
    some parts of perl installed in their home directory. I can't believe 
    that the problems come from perl but I don't know what else it could be,
    The error shown means that Glade::PerlGenerate->options has been called 
    without any arguments, not even a class name. 

    If you know what causes this please let me know.

--------------------------------------------------------------------------
