| View previous topic :: View next topic |
| Author |
Message |
plmoki Newbie

Joined: 13 May 2005 Posts: 3
|
Posted: Fri May 13, 2005 2:32 am Post subject: gtk textbuffer capturing delete signals |
|
|
Hi,
I'm programming with GTKmm. I have a textview (with a textbuffer in it). I want to capture information about the deletion of characters in the textbuffer. I'd like to know the initial start and end locations of the deletion in the buffer. I tried adding the signal "signal_erase" to the textbuffer and it is called every time perfectly. The parameters that are sent are:
const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end
unfortunately range_begin and range_end are always the same and point to the the cursor location after the delete. If range_begin was the initial location, i'd be all set. If anyone has any suggestions i'd really appreciate it.
basically i have two buffers, and i want to update the second buffer (located on a server) to reflect the one that is being edited without sending the whole buffer each time a change occurs, just the change that occurred.
Thanks a lot,
keith |
|
| Back to top |
|
 |
plmoki Newbie

Joined: 13 May 2005 Posts: 3
|
Posted: Fri May 13, 2005 10:30 am Post subject: figured it out |
|
|
textBuffer->signal_erase().connect(SigC::slot(*this,&DWBoard_UI_glade::<user defined method>), false);
the boolean false has the signal called before the action actualy occurs and the two iterators point to the beginning and end of the deleted sections.
hope this helps someone else!
Keith |
|
| Back to top |
|
 |
plmoki Newbie

Joined: 13 May 2005 Posts: 3
|
Posted: Fri May 13, 2005 10:31 am Post subject: one more thing... |
|
|
oops,
DWBoard_UI_glade is the name of my gui... so that would be different for anyone else... sorry |
|
| Back to top |
|
 |
|