Bug 43177 - Text.setText() triggers two ModifyEvents
Summary: Text.setText() triggers two ModifyEvents
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 minor (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-16 16:33 EDT by Douglas Pollock CLA
Modified: 2003-10-07 11:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Pollock CLA 2003-09-16 16:33:20 EDT
I see this behaviour in Eclipse-GTK I20030916.  The relevent lines of code in
setText(String) are:

	OS.gtk_editable_delete_text (handle, 0, -1);
	int [] position = new int [1];
	OS.gtk_editable_insert_text (handle, buffer, buffer.length, position);

The delete text method triggers a ModifyEvent.  However, if you are listening
for modify events, then the actual new text won't be set yet.  For an example,
see Bug 43168.

This is different than I'd expect and different than how Windows XP SWT works. 
On win32, the modify event is only sent after the internal state has been
updated fully.

Is this a limitation of GTK, or an implementation problem with SWT?
Comment 1 Nick Edgar CLA 2003-09-22 22:37:00 EDT
I thought that, in general in SWT, programmatic changes were not supposed to 
fire events.  Is that not the case for ModifyEvent?
Comment 2 Grant Gayed CLA 2003-09-29 17:33:20 EDT
Fixed > 0929 for gtk Text (Modify and Verify events) and Combo (Modify event).

Nick: The no-fire policy does not include modify and verify events.  I don't 
know the history of this decision.