Getting object parameter from libglade
- From: German Poo Caaman~o <gpoo ubiobio cl>
- To: gtk-perl-list gnome org
- Subject: Getting object parameter from libglade
- Date: Mon, 25 Jun 2001 17:55:27 -0400
Hi,
I'm working with Gtk::GladeXML to get the widgets and Glade 0.6.2.
On glade I create a GtkFileSelection widget asigning the signal
clicked on the ok_button as follow:
Signal: clicked
Handler: on_ok_button_clicked
Data: some_data
Objeto: some_object
Well, my perl code can run my widget, but I only gets two arguments,
not three as expected.
My code look like:
sub on_btn_browse_settings_clicked {
my $xml = new Gtk::GladeXML("glade/fileselection.glade");
$xml->signal_autoconnect_from_package();
$file = $xml->get_widget('fileselection');
show $file;
}
sub on_ok_button_clicked {
my($widget, $data, $object) = @_;
print Dumper($widget);
print Dumper($data);
print Dumper($object);
}
And I get:
$VAR1 = bless( {
'_gtk' => 136573064
}, 'Gtk::Button' );
$VAR1 = 'some_data';
$VAR1 = undef;
So, where is 'some_object'?
But, If I try:
my $xml = new Gtk::GladeXML("glade/fileselection.glade");
$file = $xml->get_widget('fileselection');
$file->ok_button->signal_connect("clicked", \&on_ok_button_clicked,
$some_object);
it works. But, IMHO is not the idea to define the signal manually.
Any idea or hint?
Thanks in advance,
--
German Poo Caaman~o
mailto:gpoo ubiobio cl
http://www.ubiobio.cl/~gpoo/chilelindo.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]