discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GNUstep, GNUMail.app, etc...


From: Nicola Pero
Subject: Re: GNUstep, GNUMail.app, etc...
Date: Sun, 6 May 2001 14:13:32 +0100 (BST)

Hi Ludovic,

    Ludovic> Seconly, I'll like to know if there's a way to set the
    Ludovic> width of a NSCell (or NSButtonCell) object. I can't seem
    Ludovic> to figure out that simple problem.

Ahm - I don't know exactly what you need to do, so my answer could be
a bit generic and confusing, but I hope it helps.

A cell has no width.

The cell holds the string (or other value) to be drawn, and all its
attributes, and knows how to draw the value with these attributes.
Each time the cell is asked to draw its value, it is given a rectangle
in which to draw it.  It is the caller (usually the associated
control) which decides - each time - the rectangle in which to draw -
the cell just obeys external orders to draw itself in a certain
rectangle, which could change with each call.

The cell is usually managed by a control (NSButton, NSMatrix, ...).
The control is a view - which means it represents an area in a window
- and asks the cell (/cells if it uses many of them) to draw the value
somewhere inside its area - the control (depending on the kind of
control and its appearance) decides where and when to draw, and how
big the rectangle in which the cell should draw.

So - if you want to change the area in which the cell draws, you
certainly need to use a method of the corresponding control.

In practice -

 * if your cell is used by a NSButton, you need to change the size of
   the NSButton (by using -setFrame: or -sizeToFit or similar)

 * if your cell is contained in a NSMatrix, you need to use [NSMatrix
   -setCellSize:] or [NSMatrix setIntercellSpacing:] or similar.

 * if your cell is used by some other type of control, you need to
   look for sizing methods in the control, not in the cell.

I hope that helps, and welcome back :-)



reply via email to

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