Re: NSTableCellView Constraints?
On Tue, Jan 27, 2015, at 07:25 PM, Thomas Wetmore wrote: > I defer to the experts. But for me view-based tables no longer work 'as > expected’ (how they worked with cell-based tables). That is, one now has > to explicitly add constraints in order to get the text in cells to widen > and shrink properly as the user widens and shrinks column headers. You can use a regular NSControl subclass as the cell view of a table view. It does not need to be embedded in an NSTableCellView. Then you don't need to specify any constraints at all. > To me, > a non expert, this is disconcerting when first encountered, and seems > sloppy, and like something overlooked. It is just one more of thousands > of little irksome details that I must fight may way through to learning > in order to get a good looking Mac app. But thanks to this list I can add > constraints in order to get that expected behavior. It sounds like a good enhancement request to file here might be: "When converting a table view from cell-based to view-based, Interface Builder should automatically add constraints that fill the cell views." --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
On 27 Jan 2015, at 5:53 pm, Steve Mills wrote: > I 100% agree. A table column that does not auto-resize is a very poor design. > No right UX designer would make it do that. The table column resizes just fine -- the issue is that you need to specify how you want the stuff within to resize in accord. This very fact is a blessing, since it affords you control. Perhaps you have a view you'd like right-justified? Or proportionally sized? Is UIKit supposed to guess this? b -- Ben Kennedy, chief magician Zygoat Creative Technical Services http://www.zygoat.ca ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On Jan 27, 2015, at 19:25, Thomas Wetmore wrote: > > I defer to the experts. But for me view-based tables no longer work 'as > expected’ (how they worked with cell-based tables). That is, one now has to > explicitly add constraints in order to get the text in cells to widen and > shrink properly as the user widens and shrinks column headers. To me, a non > expert, this is disconcerting when first encountered, and seems sloppy, and > like something overlooked. It is just one more of thousands of little irksome > details that I must fight may way through to learning in order to get a good > looking Mac app. But thanks to this list I can add constraints in order to > get that expected behavior. I 100% agree. A table column that does not auto-resize is a very poor design. No right UX designer would make it do that. Steve via iPad ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On Jan 27, 2015, at 7:48 PM, Roland King wrote: > >> On 28 Jan 2015, at 08:35, Kyle Sluder wrote: >> >> On Tue, Jan 27, 2015, at 05:34 PM, Roland King wrote: >>> No I don’t think so. I can’t think of a case IB adds constraints to >>> anything automatically at this point. >> >> If you do not specify any constraints on a view, at compile time Xcode 6 >> will install leading, top, width, and height constraints to mimic the >> behavior you get with auto layout disabled. This makes it possible to >> compile, debug, and test your app before you've set up all your >> constraints. Without this feature, all your underspecified views get >> resized to (0,0,0,0). > > Yes I pointed that out a few mails back up the thread. > > let me re-phrase to be clearer. IB no-longer adds (and attempts to maintain, > and refuses to allow you to remove) explicit constraints when you add views > to your layout as it used to back in Xcode 4. Hence I don’t think the lack of > automatically added explicit constraints between a dragged-in NSTableCellView > and its subviews is because auto layout is ‘in flux’ but because that’s how > Xcode works these days, and much better for it it is too. I defer to the experts. But for me view-based tables no longer work 'as expected’ (how they worked with cell-based tables). That is, one now has to explicitly add constraints in order to get the text in cells to widen and shrink properly as the user widens and shrinks column headers. To me, a non expert, this is disconcerting when first encountered, and seems sloppy, and like something overlooked. It is just one more of thousands of little irksome details that I must fight may way through to learning in order to get a good looking Mac app. But thanks to this list I can add constraints in order to get that expected behavior. Tom Wetmore ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On 28 Jan 2015, at 08:35, Kyle Sluder wrote: > > On Tue, Jan 27, 2015, at 05:34 PM, Roland King wrote: >> No I don’t think so. I can’t think of a case IB adds constraints to >> anything automatically at this point. > > If you do not specify any constraints on a view, at compile time Xcode 6 > will install leading, top, width, and height constraints to mimic the > behavior you get with auto layout disabled. This makes it possible to > compile, debug, and test your app before you've set up all your > constraints. Without this feature, all your underspecified views get > resized to (0,0,0,0). > > --Kyle Sluder Yes I pointed that out a few mails back up the thread. let me re-phrase to be clearer. IB no-longer adds (and attempts to maintain, and refuses to allow you to remove) explicit constraints when you add views to your layout as it used to back in Xcode 4. Hence I don’t think the lack of automatically added explicit constraints between a dragged-in NSTableCellView and its subviews is because autolayout is ‘in flux’ but because that’s how Xcode works these days, and much better for it it is too. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
On Tue, Jan 27, 2015, at 05:34 PM, Roland King wrote: > No I don’t think so. I can’t think of a case IB adds constraints to > anything automatically at this point. If you do not specify any constraints on a view, at compile time Xcode 6 will install leading, top, width, and height constraints to mimic the behavior you get with auto layout disabled. This makes it possible to compile, debug, and test your app before you've set up all your constraints. Without this feature, all your underspecified views get resized to (0,0,0,0). --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On 28 Jan 2015, at 01:50, Thomas Wetmore wrote: > > >> On Jan 27, 2015, at 12:06 PM, Steve Mills wrote: >> >> On Jan 27, 2015, at 10:48:29, Roland King wrote: >>> Using IB to check the constraints on the NSTextField within the NSTableCellView, IB states: “The selected views have no constraints. At build time, explicit left, top, width, and height constraints will be generated for the view.” If this is true, then the constraints that are generated are preventing the text field from getting wider than the launch time width of the column. >>> >>> So there you go. Exactly as I said there are no constraints fixing the text >>> field to the cell so it's getting a fixed width and height and position at >>> runtime. So add some. Don't worry about the cell itself, the table view >>> will sort that out, just constrain your text view to pin to the edges of >>> the cell so it expands as the column does. > > Thanks. This worked for me also. I believe IB should set up these constraints > by default, but that things are still in a state of flux. > No I don’t think so. I can’t think of a case IB adds constraints to anything automatically at this point. That was Xcode 4 where it attempted to guess what the user wanted and add and remove constraints to keep the layout unambiguous and fully constrained and it was pretty much unusable, shifting a view by 1px could destroy 20 minutes of work. Now you get the views you add and if you want to constrain them, you can and if you don’t you don’t. This all works much better than Xcode 4, or even 5 and although the constraint system still causes me some head-scratching moments, the tools and visualization of the constraints you’ve added, and the ability to select and edit them and see live what’s going on, is 1000x better than it was when autolayout first burst upon us. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On Jan 27, 2015, at 12:06 PM, Steve Mills wrote: > > On Jan 27, 2015, at 10:48:29, Roland King wrote: >> >>> >>> Using IB to check the constraints on the NSTextField within the >>> NSTableCellView, IB states: “The selected views have no constraints. At >>> build time, explicit left, top, width, and height constraints will be >>> generated for the view.” If this is true, then the constraints that are >>> generated are preventing the text field from getting wider than the launch >>> time width of the column. >> >> So there you go. Exactly as I said there are no constraints fixing the text >> field to the cell so it's getting a fixed width and height and position at >> runtime. So add some. Don't worry about the cell itself, the table view will >> sort that out, just constrain your text view to pin to the edges of the cell >> so it expands as the column does. > > I was also just messing around with a table view and adding constraints. I > selected each NSTextField inside the table view cells, clicked the Pin button > at the bottom, and turned on the left and right constraints, leaving the > default values of 2 and 3). Now the cells resize as I resize the columns and > as I resize the window (because the table view is pinned to the 4 sides of > the window). Thanks. This worked for me also. I believe IB should set up these constraints by default, but that things are still in a state of flux. Tom Wetmore ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
On Jan 27, 2015, at 10:48:29, Roland King wrote: > >> >> Using IB to check the constraints on the NSTextField within the >> NSTableCellView, IB states: “The selected views have no constraints. At >> build time, explicit left, top, width, and height constraints will be >> generated for the view.” If this is true, then the constraints that are >> generated are preventing the text field from getting wider than the launch >> time width of the column. > > So there you go. Exactly as I said there are no constraints fixing the text > field to the cell so it's getting a fixed width and height and position at > runtime. So add some. Don't worry about the cell itself, the table view will > sort that out, just constrain your text view to pin to the edges of the cell > so it expands as the column does. I was also just messing around with a table view and adding constraints. I selected each NSTextField inside the table view cells, clicked the Pin button at the bottom, and turned on the left and right constraints, leaving the default values of 2 and 3). Now the cells resize as I resize the columns and as I resize the window (because the table view is pinned to the 4 sides of the window). -- Steve Mills Drummer, Mac geek ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
>> >> None of the above I’d expect. What constraints are there between the text >> view and the cell which contains it? I don’t remember there being any by >> default, which means at runtime some would be implicitly added, probably a >> fixed position and fixed width constraint if you hadn’t added some in >> yourself. >> >> > > Using IB to check the constraints on the NSTextField within the > NSTableCellView, IB states: “The selected views have no constraints. At build > time, explicit left, top, width, and height constraints will be generated for > the view.” If this is true, then the constraints that are generated are > preventing the text field from getting wider than the launch time width of > the column. So there you go. Exactly as I said there are no constraints fixing the text field to the cell so it's getting a fixed width and height and position at runtime. So add some. Don't worry about the cell itself, the table view will sort that out, just constrain your text view to pin to the edges of the cell so it expands as the column does. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On Jan 27, 2015, at 10:48 AM, Roland King wrote: > > >> On 27 Jan 2015, at 22:32, Thomas Wetmore wrote: >> There must be a constraint problem, and I have been playing around with them >> for awhile, but no joy yet. Googling has not turned up a similar issue. I >> would have assumed that when I dragged the NSTableCellView into the >> NSTableColumn using IB, that IB would have established the constraints >> between the cell view and the column view properly. > > No it probably didn’t, but that’s ok, the tableview knows how to keep the > cell the width as the column. It may do it with constraints, or use > autoresizing masks. I would assume this also. But it does not seem to be happening. > >> Apparently not. Is this a known Swift/Cocoa bug or IB bug? > > None of the above I’d expect. What constraints are there between the text > view and the cell which contains it? I don’t remember there being any by > default, which means at runtime some would be implicitly added, probably a > fixed position and fixed width constraint if you hadn’t added some in > yourself. > > Using IB to check the constraints on the NSTextField within the NSTableCellView, IB states: “The selected views have no constraints. At build time, explicit left, top, width, and height constraints will be generated for the view.” If this is true, then the constraints that are generated are preventing the text field from getting wider than the launch time width of the column. Checking the constraints on the NSTableCellView within the NSTableColumn, IB states: “This view has no constraints.” As always I am probably doing something stupid possibly obviously stupid. I will reread the Table View Programming guide another time! Thanks, Tom Wetmore ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
I have the XIB set for auto layout. However, after dragging an NSTableCellView into the NSTableHeader, IB’s size inspector (for the table cell view) reports that there are no constraints on the cell view. This is clearly the issue. Since I am learning Swift, cell-based views, and auto-layout all at the same time now, I am still a bit caught up in separating the wheat of knowledge from the chaff of information. The Apple example for view-based tables, TableViewPlayground, does not use auto layout, and has the autoresizing mask for the cell view set to exactly track the enclosing view. I must learn how to do the same with auto layout. I am just surprised that IB didn’t set the right constraints. This may have been my fault because I converted to table to view-based by manually by removing all the cells and then changing its type directly, and then adding in the cell views. Maybe the manual conversion rather than starting with a new table set for view cells causes IB it omit a step. Still experimenting to find out. Thanks, Tom Wetmore > On Jan 27, 2015, at 10:23 AM, Keary Suska wrote: > > Well, constraints are fully inspectable. What do they show? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
> On 27 Jan 2015, at 22:32, Thomas Wetmore wrote: > There must be a constraint problem, and I have been playing around with them > for awhile, but no joy yet. Googling has not turned up a similar issue. I > would have assumed that when I dragged the NSTableCellView into the > NSTableColumn using IB, that IB would have established the constraints > between the cell view and the column view properly. No it probably didn’t, but that’s ok, the tableview knows how to keep the cell the width as the column. It may do it with constraints, or use autoresizing masks. > Apparently not. Is this a known Swift/Cocoa bug or IB bug? None of the above I’d expect. What constraints are there between the text view and the cell which contains it? I don’t remember there being any by default, which means at runtime some would be implicitly added, probably a fixed position and fixed width constraint if you hadn’t added some in yourself. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableCellView Constraints?
On Jan 27, 2015, at 7:32 AM, Thomas Wetmore wrote: > I have a multi-column table that I am converting from an ObjC/cell-based > implementation to a Swift/view-based implementation. The cells are text, so I > am now using a vanilla text-only NSTableCellView in each column. > > When the application launches, I can shrink the columns just fine — the text > shrinks as it should. > > BUT, when I widen the columns the text widens until it reaches the width of > the INITIAL LAUNCH TIME WIDTH, and widens no further, no matter how wide I > make the columns. > > There must be a constraint problem, and I have been playing around with them > for awhile, but no joy yet. Googling has not turned up a similar issue. I > would have assumed that when I dragged the NSTableCellView into the > NSTableColumn using IB, that IB would have established the constraints > between the cell view and the column view properly. Apparently not. Is this a > known Swift/Cocoa bug or IB bug? Does anyone know the proper workaround? I am > running Xcode 6.2 beta 4. Well, constraints are fully inspectable. What do they show? Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTableCellView Constraints?
I have a multi-column table that I am converting from an ObjC/cell-based implementation to a Swift/view-based implementation. The cells are text, so I am now using a vanilla text-only NSTableCellView in each column. When the application launches, I can shrink the columns just fine — the text shrinks as it should. BUT, when I widen the columns the text widens until it reaches the width of the INITIAL LAUNCH TIME WIDTH, and widens no further, no matter how wide I make the columns. There must be a constraint problem, and I have been playing around with them for awhile, but no joy yet. Googling has not turned up a similar issue. I would have assumed that when I dragged the NSTableCellView into the NSTableColumn using IB, that IB would have established the constraints between the cell view and the column view properly. Apparently not. Is this a known Swift/Cocoa bug or IB bug? Does anyone know the proper workaround? I am running Xcode 6.2 beta 4. Thanks. Tom Wetmore, Chief Bottle Washer DeadEnds Software ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com