NSMatrix with radio buttons dynamically filled via bindings - wrong layout
NSMatrix with radio buttons dynamically filled via bindings - wrong layout
- Subject: NSMatrix with radio buttons dynamically filled via bindings - wrong layout
- From: email@hidden
- Date: Sat, 04 Jun 2011 19:38:36 +0200
Hi all,
I have a window with an NSMatrix with radio buttons whose content is connected via bindings to an array controller which basically holds the strings for the radio buttons. The creation of the radio buttons works fine, but the layout of the NSMatrix is strange.
Firstly the radio bottoms are displayed at the bottom border of the NSMatrix although they are displayed at the top in IB/the IB part of Xcode.
(see IB-image.png for the IB view (with the NSMatrix selected and autosizing properties shown) and MatrixWith3Buttons.png for the actual window that results from three radio buttons being added at runtime one after another. For better understanding I made the NSMatrix draw its background in a different color)
[siehe angehängte Datei: IB-image.png] [siehe angehängte Datei: MatrixWith3Buttons.tiff]
Secondly, new buttons are added below the existing buttons (as expected) but are added at the bottom border and move the other buttons upwards (unexpected).
Thirdly, the buttons are not restricted to the original border and overlap with the label above the NSMatrix and even leave the window (See MatrixWith9Buttons.png). Not what I want.
[siehe angehängte Datei: MatrixWith9Buttons.tiff]
Fourthly, I tried to put the NSMatrix into an NSScrollView to better cope with the unforeseeable size changes. The ScrollView did clip the NSMatrix to its bounds but didn't display scrollbars when the matrix exceeded its viewport. (see MatrixInScrollView.png)
[siehe angehängte Datei: MatrixInScrollView.tiff]
Is it possible to configure the NSMatrix with radio buttons in a way that the buttons are at the top and it extends to the bottom? I did not find any properties in IB that seemed to help me. Can I do it in code? Why is it that the ScrollView displays no scroll bars although the NSMatrix is too big to fit into it?
And if all else fails: Can I observe the NSMatrix to be notified when a cell is added (or at least when its size changes) and do the layout myself? I looked at the delegate of NSMatrix but it only sends message that are related to text editing.
Best regards,
Joachim
Attachment:
IB-image.png
Description: PNG image
Attachment:
MatrixWith3Buttons.tiff
Description: TIFF image
Attachment:
MatrixWith9Buttons.tiff
Description: TIFF image
Attachment:
MatrixInScrollView.tiff
Description: TIFF image
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden