Having issues porting a CellRenderer / CellEditable to Gtk3



Hi all.

One of my Gtk2 projects has some customer CellRenderers. I've done the basic s/Gtk2/Gtk3/ on everything ... and now my treeview code is dying with:

GLib-GObject-CRITICAL **: Object class My__CellEditableText doesn't implement property 'editing-canceled' from interface 'GtkCellEditable' at /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux-thread-multi/Glib/Object/Subclass.pm line 233.

I didn't used to have to implement that. What's more, I wouldn't know where to start in implementing it :/ What I have I copied from Odot :)

Are there any docs on this ( ie what's required when subclassing a GtkCellEditable ) ... or even better ... what's changed between Gtk2 and Gtk3 more generally?

Dan

---

package My::CellEditableText;

use strict;
use warnings;

use Glib qw(TRUE FALSE);
use Glib::Object::Subclass
  Gtk3::TextView::,
  interfaces => [ Gtk3::CellEditable:: ];

sub set_text {

    my ( $editable, $text ) = @_;

    $text = "" unless ( defined( $text ) );

    $editable->get_buffer()->set_text( $text );

}

sub get_text {

    my ( $editable ) = @_;
    my $buffer = $editable->get_buffer();

    return $buffer->get_text( $buffer->get_bounds(), TRUE );

}

sub select_all {

    my ( $editable ) = @_;
    my $buffer = $editable->get_buffer();

    my ( $start, $end ) = $buffer->get_bounds();
    $buffer->move_mark_by_name( insert => $start );
    $buffer->move_mark_by_name( selection_bound => $end );

}

1;


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