O5B-->

About GNOME · Download · Support · Community · Developers · Foundation · Contact




GNOME Support Forums
GNOME Desktop user support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gtk textbuffer capturing delete signals

 
Post new topic   Reply to topic    GNOME Support Forums Forum Index -> Development
View previous topic :: View next topic  
Author Message
plmoki
Newbie
Newbie


Joined: 13 May 2005
Posts: 3

PostPosted: Fri May 13, 2005 2:32 am    Post subject: gtk textbuffer capturing delete signals Reply with quote

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
View user's profile Send private message
plmoki
Newbie
Newbie


Joined: 13 May 2005
Posts: 3

PostPosted: Fri May 13, 2005 10:30 am    Post subject: figured it out Reply with quote

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
View user's profile Send private message
plmoki
Newbie
Newbie


Joined: 13 May 2005
Posts: 3

PostPosted: Fri May 13, 2005 10:31 am    Post subject: one more thing... Reply with quote

oops,

DWBoard_UI_glade is the name of my gui... so that would be different for anyone else... sorry
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    GNOME Support Forums Forum Index -> Development All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


FootNotes | Official GNOME Website | GnomeSupport.org

Add to Mozilla Sidebar

Powered by phpBB © 2001, 2005 phpBB Group