[PYGTK] Insert Backspace into text widget?

D

Dennis Craven

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
 
P

Peter Hansen

Dennis said:
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
 
D

Dennis Craven

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
 
R

Riccardo Attilio Galli

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top