Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Mac os x port

Martin,

Ad Tree/TreeItem: The fileviewer example mostly works now :-). Seems
like I can finish it soon.

Cool!


1. Icon creation doesn´t work correctly:

snippet from handleItemCallback (the columns type is:
OS.kDataBrowserIconAndTextType):
	int iconHandle = 0;
	try {
		iconHandle= Image.carbon_createCIcon(item.getImage());
		int status = OS.SetDataBrowserItemDataIcon(itemData,
iconHandle);
	} finally {
		if (iconHandle != 0) {
			Image.disposeCIcon(iconHandle);
		}
	}
The displayed Tree shows the disclosure, some empty space (for the
icon) and then the column´s txt.

OS.SetDataBrowserItemDataIcon  expects an IconRef. As far as I know
is a CIcon not an IconRef.  Since I don't have code for converting
CIcons to IconRefs, a cheap way to get Tree icons would be to use a
custom cell type and to draw the SWT image directly. In addition I
don't think that SetDataBrowserItemDataIcon creates a copy of the
icon, so you shouldn't dispose it too early (but I'm not sure about
this).



2. What is TreeItem´s "grayed" property for ?

If you have a 'checked' tree (with a checkbox column), the 'gray'
state is a third state indicating that a TreeItem isn't completely on
or off. This is used when not all children of the node are either on
or off. The Carbon checkbox supports that too.


3. Where can I get a testsuite for Tree/TreeItem and what do I have
to do to get the test environment up and running?

I don't know. I'm always using Eclipse as a test case :-)
May be someone from the SWT team can answer this.


4. What actions should be performed during the methods dealing with
construction and deletion of widgets?

I'm not sure that I completely understand your question.
However, I would try to keep the code as close as possible to similar
widgets under win32 or motif.
So typically I only modify the createHandle method.

--andre


Back to the top