Re: SimpleList cellrenderer/signals

On Sun, 2004-07-11 at 13:10, Jens Wilke wrote:

i'd like to connect an signal to a CellRendererToggle in simplelist.
Any ideas welcome.

The method get_renderer as proposed here
is not implemented. That's pity, because it seems not possible to define 
an own cellrenderer for SimpleList.
The following code results "Can't locate object method "new" via package 
"Gtk2::CellRendererToggle=HASH(0x862bb5c)" (perhaps you forgot to load 
at /usr/local/lib/perl/5.8.3/Gtk2/ line 105."

   my $renderer = Gtk2::CellRendererToggle->new;
   Gtk2::SimpleList->add_column_type( 'del', 
          type     => 'Glib::Boolean',
        renderer => "$renderer",

you're stringifying a renderer object and putting that into the renderer
hash key. what you likely need to do there is 
        renderer => 'Gtk2::CellRendererToggle',
see examples/ in the Gtk2 source. you shouldn't be creating
a renderer to pass into add column. you should be telling it what kind
of renderer to use when it gets that type of column. perhaps it should
be renderer_type, but the documentation does explain that it is a type
string, not an actual renderer.

Some smaller hints for the docu:

the method get_column is not described in the perldoc 2004-04-12.

there isn't a method Gtk2::SimpleList::get_column. that method is on the
parent class Gtk2::TreeView and is doced as it should be on it's page.

"Add a new column type to the list of possible types. Initially six 
column types are defined, text, int, double, bool, scalar, and pixbuf"
'bool' is unknown, seems to be 'boolean'.

from list of column types:
        'bool'   => {type=>'Glib::Boolean', 
the column type in there appears to be 'bool' not boolean.  in fact the
default 'bool' column type uses
        renderer =>  Gtk2::CellRendererToggle
as i suggested above.


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