|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
NSTableView, highlight colorHi all,
setting a table's background is easy, but how do I set it's highlight color? I tried using an attributed string in tableWillDisplayCell:, but to no avail. Best regards, Marko +-------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | | http://www.geocities.com/markoriedelde/index.html | +-------------------------------------------------------------+ __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorNot sure, what you want to achive, but there is setBackgroundColor: on NSTableView which will set the colour of the actual table background. In the delegate method tableView:willDisplayCell:forTableColumn:row: you may set the cell background, the value to display is only set later on and is determined by the data source.
Hope this helps, Fred -------- Original-Nachricht -------- > Datum: Tue, 29 Jul 2008 16:17:24 +0000 (GMT) > Von: Marko Riedel <markoriedelde@...> > An: DISCUSS GNUstep <discuss-gnustep@...> > Betreff: NSTableView, highlight color > Hi all, > > setting a table's background is easy, but how do I set it's highlight > color? > > I tried using an attributed string in tableWillDisplayCell:, but to no > avail. > > Best regards, > > Marko > > +-------------------------------------------------------------+ > | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | > | http://www.geocities.com/markoriedelde/index.html | > +-------------------------------------------------------------+ > > > __________________________________________________________ > Gesendet von Yahoo! Mail. > Dem pfiffigeren Posteingang. > http://de.overview.mail.yahoo.com > > > _______________________________________________ > Discuss-gnustep mailing list > Discuss-gnustep@... > http://lists.gnu.org/mailman/listinfo/discuss-gnustep -- Psssst! Schon das coole Video vom GMX MultiMessenger gesehen? Der Eine für Alle: http://www.gmx.net/de/go/messenger03 _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorHello there,
I tried it like this: - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { NSLog(@"here"); [aCell setBackgroundColor:[NSColor redColor]]; } Is that what you mean? I get a bunch of log messages, so it is getting called, although not nearly enough given the size of the tables being displayed. Anyhow, there is no red background to be seen anywhere. I suspect I'm missing something very basic here. Best regards, Marko +-------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | | http://www.geocities.com/markoriedelde/index.html | +-------------------------------------------------------------+ --- Fred Kiefer <FredKiefer@...> schrieb am Di, 29.7.2008: > Von: Fred Kiefer <FredKiefer@...> > Betreff: Re: NSTableView, highlight color > An: markoriedelde@..., discuss-gnustep@... > Datum: Dienstag, 29. Juli 2008, 19:00 > Not sure, what you want to achive, but there is > setBackgroundColor: on NSTableView which will set the colour > of the actual table background. In the delegate method > tableView:willDisplayCell:forTableColumn:row: you may set > the cell background, the value to display is only set later > on and is determined by the data source. > > Hope this helps, > Fred > > -------- Original-Nachricht -------- > > Datum: Tue, 29 Jul 2008 16:17:24 +0000 (GMT) > > Von: Marko Riedel <markoriedelde@...> > > An: DISCUSS GNUstep <discuss-gnustep@...> > > Betreff: NSTableView, highlight color > > > Hi all, > > > > setting a table's background is easy, but how do I > set it's highlight > > color? > > > > I tried using an attributed string in > tableWillDisplayCell:, but to no > > avail. > > > > Best regards, > > > > Marko > > > > > +-------------------------------------------------------------+ > > | Marko Riedel, EDV Neue Arbeit gGmbH, > markoriedelde@... | > > | http://www.geocities.com/markoriedelde/index.html > | > > > +-------------------------------------------------------------+ > > > > > > > __________________________________________________________ > > Gesendet von Yahoo! Mail. > > Dem pfiffigeren Posteingang. > > http://de.overview.mail.yahoo.com > > > > > > _______________________________________________ > > Discuss-gnustep mailing list > > Discuss-gnustep@... > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > -- > Psssst! Schon das coole Video vom GMX MultiMessenger > gesehen? > Der Eine für Alle: http://www.gmx.net/de/go/messenger03 > > > _______________________________________________ > Discuss-gnustep mailing list > Discuss-gnustep@... > http://lists.gnu.org/mailman/listinfo/discuss-gnustep __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorIf you want the same colour for all cells you should rather change the data cell of the column.
Your code should work, but you may also have to set setDrawsBackground: to YES. And of course the cells needs to respond to these two methods. (This works int he default case) Fred -------- Original-Nachricht -------- > Datum: Tue, 29 Jul 2008 17:21:43 +0000 (GMT) > Von: Marko Riedel <markoriedelde@...> > An: discuss-gnustep@..., Fred Kiefer <FredKiefer@...> > Betreff: Re: NSTableView, highlight color > Hello there, > > I tried it like this: > > - (void)tableView:(NSTableView *)aTableView > willDisplayCell:(id)aCell > forTableColumn:(NSTableColumn *)aTableColumn > row:(NSInteger)rowIndex > { > NSLog(@"here"); > [aCell setBackgroundColor:[NSColor redColor]]; > } > > Is that what you mean? I get a bunch of log messages, so it is getting > called, although not nearly enough given the size of the tables being > displayed. Anyhow, there is no red background to be seen anywhere. > > I suspect I'm missing something very basic here. > > Best regards, > > Marko > > +-------------------------------------------------------------+ > | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | > | http://www.geocities.com/markoriedelde/index.html | > +-------------------------------------------------------------+ > > > --- Fred Kiefer <FredKiefer@...> schrieb am Di, 29.7.2008: > > > Von: Fred Kiefer <FredKiefer@...> > > Betreff: Re: NSTableView, highlight color > > An: markoriedelde@..., discuss-gnustep@... > > Datum: Dienstag, 29. Juli 2008, 19:00 > > Not sure, what you want to achive, but there is > > setBackgroundColor: on NSTableView which will set the colour > > of the actual table background. In the delegate method > > tableView:willDisplayCell:forTableColumn:row: you may set > > the cell background, the value to display is only set later > > on and is determined by the data source. > > > > Hope this helps, > > Fred > > > > -------- Original-Nachricht -------- > > > Datum: Tue, 29 Jul 2008 16:17:24 +0000 (GMT) > > > Von: Marko Riedel <markoriedelde@...> > > > An: DISCUSS GNUstep <discuss-gnustep@...> > > > Betreff: NSTableView, highlight color > > > > > Hi all, > > > > > > setting a table's background is easy, but how do I > > set it's highlight > > > color? > > > > > > I tried using an attributed string in > > tableWillDisplayCell:, but to no > > > avail. > > > > > > Best regards, > > > > > > Marko > > > > > > > > +-------------------------------------------------------------+ > > > | Marko Riedel, EDV Neue Arbeit gGmbH, > > markoriedelde@... | > > > | http://www.geocities.com/markoriedelde/index.html > > | > > > > > +-------------------------------------------------------------+ > > > > > > > > > > > __________________________________________________________ > > > Gesendet von Yahoo! Mail. > > > Dem pfiffigeren Posteingang. > > > http://de.overview.mail.yahoo.com > > > > > > > > > _______________________________________________ > > > Discuss-gnustep mailing list > > > Discuss-gnustep@... > > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > > -- > > Psssst! Schon das coole Video vom GMX MultiMessenger > > gesehen? > > Der Eine für Alle: http://www.gmx.net/de/go/messenger03 > > > > > > _______________________________________________ > > Discuss-gnustep mailing list > > Discuss-gnustep@... > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > __________________________________________________________ > Gesendet von Yahoo! Mail. > Dem pfiffigeren Posteingang. > http://de.overview.mail.yahoo.com -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorI'll try this right now.
I don't want to change all cells, only the ones in the selected row if there is one. Regards, +-------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | | http://www.geocities.com/markoriedelde/index.html | +-------------------------------------------------------------+ --- Fred Kiefer <FredKiefer@...> schrieb am Di, 29.7.2008: > Von: Fred Kiefer <FredKiefer@...> > Betreff: Re: NSTableView, highlight color > An: markoriedelde@..., discuss-gnustep@... > Datum: Dienstag, 29. Juli 2008, 19:31 > If you want the same colour for all cells you should rather > change the data cell of the column. > > Your code should work, but you may also have to set > setDrawsBackground: to YES. And of course the cells needs > to respond to these two methods. (This works int he default > case) > > Fred > > > -------- Original-Nachricht -------- > > Datum: Tue, 29 Jul 2008 17:21:43 +0000 (GMT) > > Von: Marko Riedel <markoriedelde@...> > > An: discuss-gnustep@..., Fred Kiefer > <FredKiefer@...> > > Betreff: Re: NSTableView, highlight color > > > Hello there, > > > > I tried it like this: > > > > - (void)tableView:(NSTableView *)aTableView > > willDisplayCell:(id)aCell > > forTableColumn:(NSTableColumn *)aTableColumn > > row:(NSInteger)rowIndex > > { > > NSLog(@"here"); > > [aCell setBackgroundColor:[NSColor redColor]]; > > } > > > > Is that what you mean? I get a bunch of log messages, > so it is getting > > called, although not nearly enough given the size of > the tables being > > displayed. Anyhow, there is no red background to be > seen anywhere. > > > > I suspect I'm missing something very basic here. > > > > Best regards, > > > > Marko > > > > > +-------------------------------------------------------------+ > > | Marko Riedel, EDV Neue Arbeit gGmbH, > markoriedelde@... | > > | http://www.geocities.com/markoriedelde/index.html > | > > > +-------------------------------------------------------------+ > > > > > > --- Fred Kiefer <FredKiefer@...> schrieb am > Di, 29.7.2008: > > > > > Von: Fred Kiefer <FredKiefer@...> > > > Betreff: Re: NSTableView, highlight color > > > An: markoriedelde@..., > discuss-gnustep@... > > > Datum: Dienstag, 29. Juli 2008, 19:00 > > > Not sure, what you want to achive, but there is > > > setBackgroundColor: on NSTableView which will set > the colour > > > of the actual table background. In the delegate > method > > > tableView:willDisplayCell:forTableColumn:row: you > may set > > > the cell background, the value to display is only > set later > > > on and is determined by the data source. > > > > > > Hope this helps, > > > Fred > > > > > > -------- Original-Nachricht -------- > > > > Datum: Tue, 29 Jul 2008 16:17:24 +0000 (GMT) > > > > Von: Marko Riedel > <markoriedelde@...> > > > > An: DISCUSS GNUstep > <discuss-gnustep@...> > > > > Betreff: NSTableView, highlight color > > > > > > > Hi all, > > > > > > > > setting a table's background is easy, > but how do I > > > set it's highlight > > > > color? > > > > > > > > I tried using an attributed string in > > > tableWillDisplayCell:, but to no > > > > avail. > > > > > > > > Best regards, > > > > > > > > Marko > > > > > > > > > > > > +-------------------------------------------------------------+ > > > > | Marko Riedel, EDV Neue Arbeit gGmbH, > > > markoriedelde@... | > > > > | > http://www.geocities.com/markoriedelde/index.html > > > | > > > > > > > > +-------------------------------------------------------------+ > > > > > > > > > > > > > > > > __________________________________________________________ > > > > Gesendet von Yahoo! Mail. > > > > Dem pfiffigeren Posteingang. > > > > http://de.overview.mail.yahoo.com > > > > > > > > > > > > > _______________________________________________ > > > > Discuss-gnustep mailing list > > > > Discuss-gnustep@... > > > > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > > > > -- > > > Psssst! Schon das coole Video vom GMX > MultiMessenger > > > gesehen? > > > Der Eine für Alle: > http://www.gmx.net/de/go/messenger03 > > > > > > > > > _______________________________________________ > > > Discuss-gnustep mailing list > > > Discuss-gnustep@... > > > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > > > > > __________________________________________________________ > > Gesendet von Yahoo! Mail. > > Dem pfiffigeren Posteingang. > > http://de.overview.mail.yahoo.com > > -- > Psssst! Schon vom neuen GMX MultiMessenger gehört? > Der kann`s mit allen: > http://www.gmx.net/de/go/multimessenger __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorHello there,
with setDrawsBackground: I do indeed get a red background. But it does not fill the entire space between two grid lines of the table. I get grey margins on the left and on the right, like this +------------+ |GRRRRRRRRRRG| +------------+ How can I turn of these margins so that the selected row has a uniform red background, with items delineated by grey grid lines and no grey margins? Marko +-------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | | http://www.geocities.com/markoriedelde/index.html | +-------------------------------------------------------------+ --- Marko Riedel <markoriedelde@...> schrieb am Di, 29.7.2008: > Von: Marko Riedel <markoriedelde@...> > Betreff: Re: NSTableView, highlight color > An: discuss-gnustep@..., "Fred Kiefer" <FredKiefer@...> > Datum: Dienstag, 29. Juli 2008, 19:35 > I'll try this right now. > > I don't want to change all cells, only the ones in the > selected row if there is one. > > Regards, > > +-------------------------------------------------------------+ > | Marko Riedel, EDV Neue Arbeit gGmbH, > markoriedelde@... | > | http://www.geocities.com/markoriedelde/index.html > | > +-------------------------------------------------------------+ > > > --- Fred Kiefer <FredKiefer@...> schrieb am Di, > 29.7.2008: > > > Von: Fred Kiefer <FredKiefer@...> > > Betreff: Re: NSTableView, highlight color > > An: markoriedelde@..., discuss-gnustep@... > > Datum: Dienstag, 29. Juli 2008, 19:31 > > If you want the same colour for all cells you should > rather > > change the data cell of the column. > > > > Your code should work, but you may also have to set > > setDrawsBackground: to YES. And of course the cells > needs > > to respond to these two methods. (This works int he > default > > case) > > > > Fred > > > > > > -------- Original-Nachricht -------- > > > Datum: Tue, 29 Jul 2008 17:21:43 +0000 (GMT) > > > Von: Marko Riedel <markoriedelde@...> > > > An: discuss-gnustep@..., Fred Kiefer > > <FredKiefer@...> > > > Betreff: Re: NSTableView, highlight color > > > > > Hello there, > > > > > > I tried it like this: > > > > > > - (void)tableView:(NSTableView *)aTableView > > > willDisplayCell:(id)aCell > > > forTableColumn:(NSTableColumn *)aTableColumn > > > row:(NSInteger)rowIndex > > > { > > > NSLog(@"here"); > > > [aCell setBackgroundColor:[NSColor redColor]]; > > > } > > > > > > Is that what you mean? I get a bunch of log > messages, > > so it is getting > > > called, although not nearly enough given the size > of > > the tables being > > > displayed. Anyhow, there is no red background to > be > > seen anywhere. > > > > > > I suspect I'm missing something very basic > here. > > > > > > Best regards, > > > > > > Marko > > > > > > > > > +-------------------------------------------------------------+ > > > | Marko Riedel, EDV Neue Arbeit gGmbH, > > markoriedelde@... | > > > | > http://www.geocities.com/markoriedelde/index.html > > | > > > > > > +-------------------------------------------------------------+ > > > > > > > > > --- Fred Kiefer <FredKiefer@...> schrieb > am > > Di, 29.7.2008: > > > > > > > Von: Fred Kiefer <FredKiefer@...> > > > > Betreff: Re: NSTableView, highlight color > > > > An: markoriedelde@..., > > discuss-gnustep@... > > > > Datum: Dienstag, 29. Juli 2008, 19:00 > > > > Not sure, what you want to achive, but there > is > > > > setBackgroundColor: on NSTableView which > will set > > the colour > > > > of the actual table background. In the > delegate > > method > > > > > tableView:willDisplayCell:forTableColumn:row: you > > may set > > > > the cell background, the value to display is > only > > set later > > > > on and is determined by the data source. > > > > > > > > Hope this helps, > > > > Fred > > > > > > > > -------- Original-Nachricht -------- > > > > > Datum: Tue, 29 Jul 2008 16:17:24 +0000 > (GMT) > > > > > Von: Marko Riedel > > <markoriedelde@...> > > > > > An: DISCUSS GNUstep > > <discuss-gnustep@...> > > > > > Betreff: NSTableView, highlight color > > > > > > > > > Hi all, > > > > > > > > > > setting a table's background is > easy, > > but how do I > > > > set it's highlight > > > > > color? > > > > > > > > > > I tried using an attributed string in > > > > tableWillDisplayCell:, but to no > > > > > avail. > > > > > > > > > > Best regards, > > > > > > > > > > Marko > > > > > > > > > > > > > > > > > +-------------------------------------------------------------+ > > > > > | Marko Riedel, EDV Neue Arbeit gGmbH, > > > > markoriedelde@... | > > > > > | > > http://www.geocities.com/markoriedelde/index.html > > > > | > > > > > > > > > > > > +-------------------------------------------------------------+ > > > > > > > > > > > > > > > > > > > > > > __________________________________________________________ > > > > > Gesendet von Yahoo! Mail. > > > > > Dem pfiffigeren Posteingang. > > > > > http://de.overview.mail.yahoo.com > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Discuss-gnustep mailing list > > > > > Discuss-gnustep@... > > > > > > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > > > > > > -- > > > > Psssst! Schon das coole Video vom GMX > > MultiMessenger > > > > gesehen? > > > > Der Eine für Alle: > > http://www.gmx.net/de/go/messenger03 > > > > > > > > > > > > > _______________________________________________ > > > > Discuss-gnustep mailing list > > > > Discuss-gnustep@... > > > > > > http://lists.gnu.org/mailman/listinfo/discuss-gnustep > > > > > > > > > > > > __________________________________________________________ > > > Gesendet von Yahoo! Mail. > > > Dem pfiffigeren Posteingang. > > > http://de.overview.mail.yahoo.com > > > > -- > > Psssst! Schon vom neuen GMX MultiMessenger gehört? > > Der kann`s mit allen: > > http://www.gmx.net/de/go/multimessenger > > > > __________________________________________________________ > Gesendet von Yahoo! Mail. > Dem pfiffigeren Posteingang. > http://de.overview.mail.yahoo.com > > > _______________________________________________ > Discuss-gnustep mailing list > Discuss-gnustep@... > http://lists.gnu.org/mailman/listinfo/discuss-gnustep __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorMost likely these borders get caused by the code in NSTableView
frameOfCellAtColumn:row:. You could try and play with the values there and report back to us. Fred Marko Riedel wrote: > Hello there, > > with setDrawsBackground: I do indeed get a red background. But it does not fill the entire space between two grid lines of the table. I get grey margins on the left and on the right, like this > > +------------+ > |GRRRRRRRRRRG| > +------------+ > > How can I turn of these margins so that the selected row has a uniform red background, with items delineated by grey grid lines and no grey margins? > > Marko > > +-------------------------------------------------------------+ > | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | > | http://www.geocities.com/markoriedelde/index.html | > +-------------------------------------------------------------+ > > > --- Marko Riedel <markoriedelde@...> schrieb am Di, 29.7.2008: > >> Von: Marko Riedel <markoriedelde@...> >> Betreff: Re: NSTableView, highlight color >> An: discuss-gnustep@..., "Fred Kiefer" <FredKiefer@...> >> Datum: Dienstag, 29. Juli 2008, 19:35 >> I'll try this right now. >> >> I don't want to change all cells, only the ones in the >> selected row if there is one. >> >> Regards, >> >> +-------------------------------------------------------------+ >> | Marko Riedel, EDV Neue Arbeit gGmbH, >> markoriedelde@... | >> | http://www.geocities.com/markoriedelde/index.html >> | >> +-------------------------------------------------------------+ >> >> >> --- Fred Kiefer <FredKiefer@...> schrieb am Di, >> 29.7.2008: >> >>> Von: Fred Kiefer <FredKiefer@...> >>> Betreff: Re: NSTableView, highlight color >>> An: markoriedelde@..., discuss-gnustep@... >>> Datum: Dienstag, 29. Juli 2008, 19:31 >>> If you want the same colour for all cells you should >> rather >>> change the data cell of the column. >>> >>> Your code should work, but you may also have to set >>> setDrawsBackground: to YES. And of course the cells >> needs >>> to respond to these two methods. (This works int he >> default >>> case) >>> >>> Fred >>> >>> >>> -------- Original-Nachricht -------- >>>> Datum: Tue, 29 Jul 2008 17:21:43 +0000 (GMT) >>>> Von: Marko Riedel <markoriedelde@...> >>>> An: discuss-gnustep@..., Fred Kiefer >>> <FredKiefer@...> >>>> Betreff: Re: NSTableView, highlight color >>>> Hello there, >>>> >>>> I tried it like this: >>>> >>>> - (void)tableView:(NSTableView *)aTableView >>>> willDisplayCell:(id)aCell >>>> forTableColumn:(NSTableColumn *)aTableColumn >>>> row:(NSInteger)rowIndex >>>> { >>>> NSLog(@"here"); >>>> [aCell setBackgroundColor:[NSColor redColor]]; >>>> } >>>> >>>> Is that what you mean? I get a bunch of log >> messages, >>> so it is getting >>>> called, although not nearly enough given the size >> of >>> the tables being >>>> displayed. Anyhow, there is no red background to >> be >>> seen anywhere. >>>> I suspect I'm missing something very basic >> here. >>>> Best regards, >>>> >>>> Marko >>>> >>>> >> +-------------------------------------------------------------+ >>>> | Marko Riedel, EDV Neue Arbeit gGmbH, >>> markoriedelde@... | >>>> | >> http://www.geocities.com/markoriedelde/index.html >>> | >> +-------------------------------------------------------------+ >>>> >>>> --- Fred Kiefer <FredKiefer@...> schrieb >> am >>> Di, 29.7.2008: >>>>> Von: Fred Kiefer <FredKiefer@...> >>>>> Betreff: Re: NSTableView, highlight color >>>>> An: markoriedelde@..., >>> discuss-gnustep@... >>>>> Datum: Dienstag, 29. Juli 2008, 19:00 >>>>> Not sure, what you want to achive, but there >> is >>>>> setBackgroundColor: on NSTableView which >> will set >>> the colour >>>>> of the actual table background. In the >> delegate >>> method >> tableView:willDisplayCell:forTableColumn:row: you >>> may set >>>>> the cell background, the value to display is >> only >>> set later >>>>> on and is determined by the data source. >>>>> >>>>> Hope this helps, >>>>> Fred >>>>> >>>>> -------- Original-Nachricht -------- >>>>>> Datum: Tue, 29 Jul 2008 16:17:24 +0000 >> (GMT) >>>>>> Von: Marko Riedel >>> <markoriedelde@...> >>>>>> An: DISCUSS GNUstep >>> <discuss-gnustep@...> >>>>>> Betreff: NSTableView, highlight color >>>>>> Hi all, >>>>>> >>>>>> setting a table's background is >> easy, >>> but how do I >>>>> set it's highlight >>>>>> color? >>>>>> >>>>>> I tried using an attributed string in >>>>> tableWillDisplayCell:, but to no >>>>>> avail. >>>>>> _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
|
|
Re: NSTableView, highlight colorHi there,
thanks for your reply, very helpful as always. My priority at this time is to implement the features requested of the application that I'm working on, so I decided not to spend too much time on this and for now, confine myself to changing the table background. (The goal was to improve legibility for an end user who found that the black on dark grey was hard to read.) Best regards, Marko +-------------------------------------------------------------+ | Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@... | | http://www.geocities.com/markoriedelde/index.html | +-------------------------------------------------------------+ --- Fred Kiefer <fredkiefer@...> schrieb am Fr, 1.8.2008: > Von: Fred Kiefer <fredkiefer@...> > Betreff: Re: NSTableView, highlight color > An: markoriedelde@... > CC: discuss-gnustep@... > Datum: Freitag, 1. August 2008, 22:47 > Most likely these borders get caused by the code in > NSTableView > frameOfCellAtColumn:row:. You could try and play with the > values there > and report back to us. > > Fred > > Marko Riedel wrote: > > Hello there, > > > > with setDrawsBackground: I do indeed get a red > background. But it does not fill the entire space between > two grid lines of the table. I get grey margins on the left > and on the right, like this > > > > +------------+ > > |GRRRRRRRRRRG| > > +------------+ > > > > How can I turn of these margins so that the selected > row has a uniform red background, with items delineated by > grey grid lines and no grey margins? > > > > Marko > > > > > +-------------------------------------------------------------+ > > | Marko Riedel, EDV Neue Arbeit gGmbH, > markoriedelde@... | > > | http://www.geocities.com/markoriedelde/index.html > | > > > +-------------------------------------------------------------+ > > > > > > --- Marko Riedel <markoriedelde@...> > schrieb am Di, 29.7.2008: > > > >> Von: Marko Riedel <markoriedelde@...> > >> Betreff: Re: NSTableView, highlight color > >> An: discuss-gnustep@..., "Fred > Kiefer" <FredKiefer@...> > >> Datum: Dienstag, 29. Juli 2008, 19:35 > >> I'll try this right now. > >> > >> I don't want to change all cells, only the > ones in the > >> selected row if there is one. > >> > >> Regards, > >> > >> > +-------------------------------------------------------------+ > >> | Marko Riedel, EDV Neue Arbeit gGmbH, > >> markoriedelde@... | > >> | > http://www.geocities.com/markoriedelde/index.html > >> | > >> > +-------------------------------------------------------------+ > >> > >> > >> --- Fred Kiefer <FredKiefer@...> schrieb > am Di, > >> 29.7.2008: > >> > >>> Von: Fred Kiefer <FredKiefer@...> > >>> Betreff: Re: NSTableView, highlight color > >>> An: markoriedelde@..., > discuss-gnustep@... > >>> Datum: Dienstag, 29. Juli 2008, 19:31 > >>> If you want the same colour for all cells you > should > >> rather > >>> change the data cell of the column. > >>> > >>> Your code should work, but you may also have > to set > >>> setDrawsBackground: to YES. And of course the > cells > >> needs > >>> to respond to these two methods. (This works > int he > >> default > >>> case) > >>> > >>> Fred > >>> > >>> > >>> -------- Original-Nachricht -------- > >>>> Datum: Tue, 29 Jul 2008 17:21:43 +0000 > (GMT) > >>>> Von: Marko Riedel > <markoriedelde@...> > >>>> An: discuss-gnustep@..., Fred Kiefer > >>> <FredKiefer@...> > >>>> Betreff: Re: NSTableView, highlight color > >>>> Hello there, > >>>> > >>>> I tried it like this: > >>>> > >>>> - (void)tableView:(NSTableView > *)aTableView > >>>> willDisplayCell:(id)aCell > >>>> forTableColumn:(NSTableColumn > *)aTableColumn > >>>> row:(NSInteger)rowIndex > >>>> { > >>>> NSLog(@"here"); > >>>> [aCell setBackgroundColor:[NSColor > redColor]]; > >>>> } > >>>> > >>>> Is that what you mean? I get a bunch of > log > >> messages, > >>> so it is getting > >>>> called, although not nearly enough given > the size > >> of > >>> the tables being > >>>> displayed. Anyhow, there is no red > background to > >> be > >>> seen anywhere. > >>>> I suspect I'm missing something very > basic > >> here. > >>>> Best regards, > >>>> > >>>> Marko > >>>> > >>>> > >> > +-------------------------------------------------------------+ > >>>> | Marko Riedel, EDV Neue Arbeit gGmbH, > >>> markoriedelde@... | > >>>> | > >> http://www.geocities.com/markoriedelde/index.html > > >>> | > >> > +-------------------------------------------------------------+ > >>>> > >>>> --- Fred Kiefer <FredKiefer@...> > schrieb > >> am > >>> Di, 29.7.2008: > >>>>> Von: Fred Kiefer > <FredKiefer@...> > >>>>> Betreff: Re: NSTableView, highlight > color > >>>>> An: markoriedelde@..., > >>> discuss-gnustep@... > >>>>> Datum: Dienstag, 29. Juli 2008, 19:00 > >>>>> Not sure, what you want to achive, but > there > >> is > >>>>> setBackgroundColor: on NSTableView > which > >> will set > >>> the colour > >>>>> of the actual table background. In the > >> delegate > >>> method > >> tableView:willDisplayCell:forTableColumn:row: you > >>> may set > >>>>> the cell background, the value to > display is > >> only > >>> set later > >>>>> on and is determined by the data > source. > >>>>> > >>>>> Hope this helps, > >>>>> Fred > >>>>> > >>>>> -------- Original-Nachricht -------- > >>>>>> Datum: Tue, 29 Jul 2008 16:17:24 > +0000 > >> (GMT) > >>>>>> Von: Marko Riedel > >>> <markoriedelde@...> > >>>>>> An: DISCUSS GNUstep > >>> <discuss-gnustep@...> > >>>>>> Betreff: NSTableView, highlight > color > >>>>>> Hi all, > >>>>>> > >>>>>> setting a table's background > is > >> easy, > >>> but how do I > >>>>> set it's highlight > >>>>>> color? > >>>>>> > >>>>>> I tried using an attributed string > in > >>>>> tableWillDisplayCell:, but to no > >>>>>> avail. > >>>>>> __________________________________________________________ Gesendet von Yahoo! Mail. Dem pfiffigeren Posteingang. http://de.overview.mail.yahoo.com _______________________________________________ Discuss-gnustep mailing list Discuss-gnustep@... http://lists.gnu.org/mailman/listinfo/discuss-gnustep |
| Free Forum Powered by Nabble | Forum Help |