Problem with Gtk2::Deprecated v0.03
- From: Niel Das <idas watson wustl edu>
- To: gtk-perl-list gnome org
- Subject: Problem with Gtk2::Deprecated v0.03
- Date: Thu, 01 Apr 2004 14:05:15 -0600
I understand that Gtk2::Deprecated is not well supported, and should not
be used, however...
I am trying to port a set of Gtk applications to Gtk2 incrementally and
I would like applying Gtk2::Deprecated to a few method calls. I noticed
that I am having certain problems when using the
Gtk2::CList::set_row_data method call.
I get the following error:
Gtk2::CList is deprecated, use Gtk2::ListStore and Gtk2::TreeView
instead at Gtk2-Deprecated-Trial.pl line 25.
Bizarre copy of ARRAY in entersub at Gtk2-Deprecated-Trial.pl line 41.
when I try out the following program.(please see below).
I was wondering if I am using the CList::set_row_data method properly or
if I have written this test improperly or if there is some other error
that I am not aware of ?
Thanks in advance.
Cheers,
Indraniel
===================================
#!/usr/bin/perl
require 5.8.0;
use constant TRUE => 1;
use constant FALSE => 0;
use Gtk2;
use Gtk2::Deprecated;
Gtk2->set_locale(); # internationalization
Gtk2->init(); # initialization
my $dialog = Gtk2::Window->new('toplevel');
$dialog->set_title("Gtk2::Deprecated Test");
$dialog->signal_connect("delete_event", sub { Gtk2->main_quit(); } );
my $vbox = Gtk2::VBox->new(FALSE,FALSE);
$dialog->add($vbox);
my $scrolled = Gtk2::ScrolledWindow->new();
$vbox->pack_start($scrolled,TRUE,TRUE,5);
my @headers = ('a', 'b', 'c');
my $clist = Gtk2::CList->new_with_titles(@headers);
$scrolled->add($clist);
$clist->set_selection_mode('extended');
# Autoset the column widths
foreach my $col (0..$clist->columns) {
$clist->set_column_auto_resize($col, TRUE);
}
$dialog->set_default_size(500,400);
my @data = ( [1, 2, 3], [4, 5, 6], [7, 8, 9] );
for my $rowdata (@data) {
my $rowindex = $clist->append(@$rowdata);
$clist->set_row_data($rowindex,$rowdata);
}
$dialog->show_all();
Gtk2->main();
===================================
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]