Editable GtkCellRendererText, troubles with the GtkEntry...




Hi there,

I try to use a GtkCellRendererText to display and edit an icon text.

I already use a GtkCellRendererPixbuf to display the icon and it works fine, displaying the text also works :

http://s9.postimage.org/klhpmqcj3/gtkentry.png

But for some reasons, I can't get a visible GtkEntry to edit the text.

I've set the editable property and connected signals (in Vala) :

            _text_renderer = new Gtk.CellRendererText ();
            _text_renderer.editable = true;
            _text_renderer.mode = Gtk.CellRendererMode.EDITABLE;

this._text_renderer.edited.connect ( (renderer, path, text) => {
                stdout.printf ("edited\n");
            });

            this._text_renderer.editing_canceled.connect ( () => {
                stdout.printf ("editing_canceled\n");
            });

this._text_renderer.editing_started.connect ( (editable, path) => {
                stdout.printf ("editing_started\n");
            });

I try to call start_editing so that the text can be edited :
this._text_renderer.start_editing (null, _desktop, "", item.text_rect, item.text_rect, state);

Then I get the editing-started signal, the editable is created but I can't get it visible.

The parent widget is a GtkWindow with custom drawing, is it what cause some troubles ?

I tried to find a clue in GtkCellRendererText :
http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderertext.c#n2028

The function creates a GtkEntry, that should work at first glance.

I only receive the editing-started signal, but no GtkEntry, no edited or editing-canceled.

Any idea would be welcome :)

Thanks.

--
Axel FILMORE
#--------------------------------------------#
        https://github.com/afilmore
#--------------------------------------------#
 Vala - Compiler For The GObject Type System
        https://live.gnome.org/Vala
#--------------------------------------------#



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