Re: signal functions in a package module file




anguila wrote:
if I do the 2 option, when I click button1 at first window, i need the
window2 widget of aviam.pm to show it but  it's into another .glade
file, so I also need to declare this gladexml object in the main.pl?
I understand that each file can handle with they own signals, but if I
want to use (showwindows) of other .glade files, what I should do?

I think you're making it too complicated.  Here's some code fragments that
should give you the general idea.


use OtherDialog;

sub on_button_from_window_1 {
    ...
    my $text = $text = $glade_from_this_file->get_widget ('entry');

    OtherDialog->do_stuff ($text);
}


and


package OtherDialog;

sub do_stuff {
    my (undef, $text) = @_;

    my $self = {
        glade => Gtk2::GladeXML->new (...),
        ...
    };

    $self->{glade}->get_widget ('this_entry')->set_text ($text);
    $self->{glade}->get_widget ('window')->show ();
}



-- 
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]