By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,426 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,426 IT Pros & Developers. It's quick & easy.

[PYGTK] Insert Backspace into text widget?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.