469,608 Members | 2,152 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,608 developers. It's quick & easy.

[PYGTK] Insert Backspace into text widget?

Hello,

Does anyone know how one could insert a backspace into a widget such as a
TextView/Buffer in Pygtk? Whenever I try something like insert(iter, '\b')
I get jibberish inserted into the buffer.

Thanks,
~djc
Jul 18 '05 #1
3 2140
Dennis Craven wrote:
Does anyone know how one could insert a backspace into a widget such as a
TextView/Buffer in Pygtk? Whenever I try something like insert(iter, '\b')
I get jibberish inserted into the buffer.


What exactly do you expect to see when you insert a backspace
into the buffer? (Backspace is a control character, so it
is not normally "inserted into a buffer" unless you are
actually trying to display it in some way. Are you expecting
it to move the insertion point backwards one position, or what?)

-Peter
Jul 18 '05 #2
On Mon, 17 May 2004 08:27:22 -0400, Peter Hansen wrote:
What exactly do you expect to see when you insert a backspace
into the buffer? (Backspace is a control character, so it
is not normally "inserted into a buffer" unless you are
actually trying to display it in some way. Are you expecting
it to move the insertion point backwards one position, or what?)


What you say makes sense. And yes, that is what I'm trying to do. I want
to move the insertion point backwards one position, deleting the character
that was at that position. Just like pressing the backspace key.

Maybe the insert(iter, text) function is not the answer I'm looking for...
Do you know of a way to accomplish this?

Thanks,
~djc
Jul 18 '05 #3
On Mon, 17 May 2004 12:58:19 +0000, Dennis Craven wrote:
On Mon, 17 May 2004 08:27:22 -0400, Peter Hansen wrote:
What exactly do you expect to see when you insert a backspace
into the buffer? (Backspace is a control character, so it
is not normally "inserted into a buffer" unless you are
actually trying to display it in some way. Are you expecting
it to move the insertion point backwards one position, or what?)


What you say makes sense. And yes, that is what I'm trying to do. I want
to move the insertion point backwards one position, deleting the character
that was at that position. Just like pressing the backspace key.

Maybe the insert(iter, text) function is not the answer I'm looking for...
Do you know of a way to accomplish this?

Thanks,
~djc


I think you're looking for
delete(start, end)
where start and end should be iters.

Ciao,
Riccardo

--
-=Riccardo Galli=-

_,e.
s~ ``
~@. ideralis Programs
.. ol
`**~ http://www.sideralis.net
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by j_mckitrick | last post: by
2 posts views Thread by Samuele Giovanni Tonon | last post: by
reply views Thread by Franck Pommereau | last post: by
reply views Thread by Johan | last post: by
3 posts views Thread by Jeremy Bowers | last post: by
reply views Thread by Sebastien Aubry | last post: by
10 posts views Thread by jubei | last post: by
1 post views Thread by manatlan | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.