bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Transparency issues


From: Marko Mikulicic
Subject: Transparency issues
Date: Mon, 20 Aug 2001 21:49:18 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801

Hi,

I have noticed a strange effect with images in NSCells (NSButtonCell, NSImageCell).

I have a NSTableView witch has a column filled with various images.
I have a button in the same window wich displays also one of these.
When image "A" is displayed in the button, all images "A" in the
table are correctly transparent, while the others are opaque with a white background. If I change the image in the button after program restart the effect is the same.
 Since NSTableView uses the same NSCell for all cells, that would
mean that the image is correctly displayed when at least two istances
of the same image are showed on screen.
I tested various combinations (both image displayed in two buttons, both have good trasparency in table cells), with xpms and tiffs.
Other single buttons display their image correctly.

Is the button cell "smarter" than the table view cell ?
Can this derive from the fact that NSTableView uses the same cell
for all cells ?

Maybe I'm missing somthing.
I use this code in the delegate of the table view:


/////////////
- (void)tableView:(NSTableView *)aTableView
  willDisplayCell:(id)aCell
   forTableColumn:(NSTableColumn *)aTableColumn
              row:(int)rowIndex
{

  id map,image = nil,value,name;

  if([[aTableColumn identifier] isEqual: @"type"]) {
        value = [dataSource tableView: aTableView
                        objectValueForTableColumn: aTableColumn
                        row: rowIndex];

    if(value) {
map = [[[self class] iconMapping] objectForKey: [[dataSource entity] name]];

      if(map) {
        name =  [map objectForKey: [value description]];

        if(name)
          [aCell setImage: [NSImage imageNamed: name]];
      }
    }
  } else
    [aCell setType: NSTextCellType];


}
///////////////////////

Marko







reply via email to

[Prev in Thread] Current Thread [Next in Thread]