Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 108635 - Text widget in MAC OS X doesnt paint to GC
Summary: Text widget in MAC OS X doesnt paint to GC
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 47716
  Show dependency tree
 
Reported: 2005-09-01 17:10 EDT by Srimanth CLA
Modified: 2005-10-17 18:25 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srimanth CLA 2005-09-01 17:10:23 EDT
Trying to grab a screenshot of a MAC application (bug 44176), we hit a snag with
Text widgets which dont paint to the GC. The problem seems to be that Text
widgets are painting directly to the screen even when asked to paint to a GC,
specifically in Text's api:
-------------------------------------------
void drawWidget (int control, int damageRgn, int visibleRgn, int theEvent) {
	OS.TXNDraw (txnObject, 0);
	super.drawWidget (control, damageRgn, visibleRgn, theEvent);
}
-------------------------------------------

Looking at the API of OS.TXNDraw() on Apple's website at
http://developer.apple.com/documentation/Carbon/Reference/Multilingual_Text_Engine/mlte_refchap/chapter_1.2_section_19.html#//apple_ref/doc/uid/TP30000069-DontLinkChapterID_2-F12521
It says that specifying NULL or 0 in the second argument paints to the screen
instead of the buffer. Was wondering if this was what was causing the text to
not paint. An illustration of the problem can be found here:
https://bugs.eclipse.org/bugs/attachment.cgi?id=26475

The code used to capture the image:
--------------------------------------------
protected Image getImageOfControl(Control control){
	Image image = new Image(control.getDisplay(), control.getBounds());
	GC gc = new GC(control);
	gc.copyArea(image, 0, 0);
	gc.dispose();
	return image;
}
--------------------------------------------
Comment 1 Gregory Block CLA 2005-09-20 04:55:29 EDT
In the unending tide of Mac requests to get a VE up and running (so, amongst other reasons, I can actually 
work on, review, or even *gasp* look at the projects I assign to my developers)...

Can somebody take a look at this?  One by one, the community can help kick the problems that prevent VE 
from running well on the mac out of the way.  This is the last remaining hurdle that prevents the *big* 
blocker of a running SWT/VE on the mac, as far as I can see.

Eyeballs on this would be really appreciated.  One would do.  Even a squint.  ;)
Comment 2 Steve Northover CLA 2005-10-04 18:04:06 EDT
We took a quick look at trying to get the TXNObject to draw into the right 
port and it drew garbage on the screen.  We are currently looking at moving to 
HIView and using the text control, rather than the TXNObject.
Comment 3 Silenio Quarti CLA 2005-10-14 10:04:05 EDT
This is fixed by changes required for bug#41467.