Re: Question regarding cell editing mode in the Gtk::TreeView



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<snip>

>> Heh. Sorry my bad. I did mean set_cursor().
>> 
>> ...and it does not work, sadly. When I specify set_cursor( Path,
>> Column, true ), it does not force the cell into editing mode, so I
>> guess I must have just discovered a bug...?

<snip>

I too have found the following overload of set_cursor to not work properly:

void Gtk::TreeView::set_cursor(const TreeModel::Path& path,
		TreeViewColumn&	focus_column,
		CellRenderer& focus_cell,
		bool start_editing = false
	)

So long as you designed the *first* column on the row, it works (give
that column focus and begins editing).  However, if I designate the
second column (or any other column besides the first) when I make the
call, that column gets focus but it does not starting the editing
process.  I differed from Douglas in that I focused on detecting the
"enter" key to change focus to the next column (or first column on the
next row if in that last column on a row).  Running in debug mode showed
that my callback was indeed detecting the "enter" key and was calling
set_cursor.  I never submitted any bug on it because I assumed that I
was doing something wrong.


Bob Caryl

R. Douglas Barbieri wrote:
> On 9/12/06, Murray Cumming <murrayc murrayc com> wrote:
>>> Hi all,
>>>
>>> I'm trying to make a Gtk::TreeView instance behave in a certain way. I
>>> have a tree view with text cells (CellRendererText). I turn on the
>>> "editable" property for the column in question.
>>>
>>> Now I can make it go into "edit" mode (the cell suddenly accepts
>>> input) it seems only by right-clicking with a mouse. However, I don't
>>> see anything in the documentation that would allow me to
>>> programmatically "force" the cell to go into editing.
>> TreeView::set_cursor() should do this. There are three versions of that
>> method, depending on how precise you want to be:
>> http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeView.html#eace1596d745a904c79b6d1b437da778
>>
>>> What I want to do is use the "Tab" button to circle around a column,
>>> putting each cell in and out of edit mode as you go. Is there anyway
>>> to do this?
>> This should be possible, and I guess someone has achieved it. I might like
>> the same feature in Glom.
>>
>> But do remember that this might interfer with the standard keyboard
>> navigation used for acccessibility.
> 
> I use the signal_key_pressed() method to detect the tab key. I have an
> example app written which demonstrates this. If you'd like to see it,
> I can make it available.
> 
>>> PS: I found "set_column( Path, Column, bool start_editing), but it
>>> seems the "start_editing" boolean does not force the cell into edit
>>> mode.
>> Do you mean set_cursor()?
> 
> Heh. Sorry my bad. I did mean set_cursor().
> 
> ...and it does not work, sadly. When I specify set_cursor( Path,
> Column, true ), it does not force the cell into editing mode, so I
> guess I must have just discovered a bug...?
> 
>> Murray Cumming
>> murrayc murrayc com
>> www.murrayc.com
>> www.openismus.com
>>
>> _______________________________________________
>> gtkmm-list mailing list
>> gtkmm-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>>
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFCEDxuCj6XIbb5UIRAhIIAKDf48nkC8qMkqQIM//56jsrvYfHwwCfX3p5
8G2ZL/i0H5yrlYNqkBH90Ic=
=mS93
-----END PGP SIGNATURE-----
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard



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