Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

Reply to sizing a cell in the NSOutlineView
1. Just have only one column in your NSOutlineView.2. Use the Xcode view inspector or change the alignment dynamically on the appropriate NSView if your outline view is view based.As far as I understand, by default the column is set to fit the content of the cells underneath and will resize itself if the data added will be wider.Nope. The column width does not dynamically adjust to the contents of the cell. At least that's how it works when AutoLayout is disabled. And I don't remember it working differently when AutoLayout is enabled.
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’20
Reply to create csv or xls file
XLS files are complex so I’m going to ignore that.CSV files are a lot less complex—although more complex than most folks think—so I’ll focus there. Here’s some simplifying assumptions:you’re build an iOS or Mac app, and thus have access to Foundationthe data will be small enough to fit in memory easilythe text encoding will be UTF-8the line breaks will be Windows style (CR LF)the items won’t include any weird characters (like CR or LF)Based on those requirements, here’s an implementation that optimised for readability:import Foundation func quoteColumn(column: String) -> String { if column.containsString(,) || column.containsString() { return + column.stringByReplacingOccurrencesOfString(, withString: ) + } else { return column } } func commaSeparatedValueStringForColumns(columns: [String]) -> String { return columns.map {column in quoteColumn(column) }.joinWithSeparator(,) } func commaSeparatedValueDataForLines(lines: [[String]]) -> NSData { return line
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’15
Reply to CSV to SwiftUI
How do I now separate the two columns from each other You could use a HStack . how do I implement this in a ForEach struct If I understand correctly, I would create 2 computed var to hold each of the columns content. And use these var in 2 ForEach in the HStack
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to Protocol Oriented Programming boilerplate code
I think there's more going on here than you think.What you're really asking for is inheritance, which currently does not exist for value types. Protocol extensions are vaguely similar to inheritance in some ways, but not currently so far as to allow you to have default stored properties.You could use inheritance if your columns were classes instead of structs. Indeed, in this case, I think it's clear that your columns should be classes instead of structs. Generally, structs are inappropriate when their value represents the state of some thing, whether it's a real world object or a specific entity like a column (presumable of some table or list). In this case, a particular column has one true name, presumably along with other one true properties that you haven't shown us. If the column's one true state is immutable, it doesn't really matter whether it's a value type or a reference type, but if it's mutable as yours seems likely to be, then it's almost certainly bett
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’15
Reply to Illegal NSTableViewDataSource
Hello Claude31:I get a crash on line 5 of this code when I move viewForTableColumn outside configureCell:func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView?{ let cell = tableView.makeView(withIdentifier: (tableColumn!.identifier), owner: self) as? NSTableCellView let column = tableView.tableColumns.firstIndex(of: tableColumn!)! configureCell(cell: cell!, row: row, column: column) return cell }Crash log: unexpectedly found nil when implicitly unwrapping ...
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to NSBrowser....conditionally suppress right-click menu
I guess menuForEvent: must get called on a subview of NSBrowser, and it must eat it. There doesn't seem to be a clean way to handle this. I can override menuForEvent: on a NSMatrix subclass, if I set a custom matrix class..though that API is deprecated.What I want to do, is when a user right-clicks, and no column/row is selected, I want nothing to happen (no menu to show). I can be a bit hacky by using validateMenuItem: and hiding everything in there. Doing this isn't great either, because I can right click in a different column than the selected column and the menu will show...since I don't have the NSEvent to check the location of the click against, it seems that I have to add another layer of nasty code by converting the current cursor's position. None of this feels clean.Edit: Seems that I can set the menu property on each cell in browser:willDisplayCell:atRow:column:Far as handling right clicks in blank areas and showing an alternative menu depening on what that column
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’15
Reply to How to turn off background extension effect in UISplitViewController?
I just had a chance to test this under iPadOS 26.1 beta 2. Great news - if the primaryBackgroundStyle property of the split view is set to .none then we get back the old style tile layout and none of the content of the other columns appear behind the primary column. Thank you. If the primaryBackgroundStyle is set to .sidebar, the primary column is inset a bit as it has been since iPadOS 26.0 (and that's fine for a sidebar). But there is still some unwanted extension of content from the other columns behind the primary column. It's not nearly as bad as iPadOS 26.0. Running the app I used for the screenshot in the first post of this thread now results in just the background color of the selected row appearing on the far left. The section headers do not extend to the far left any more. Here's how it looks now with primaryBackgroundStyle = .none with iPadOS 26.1 beta 2: Here's how it looks now with primaryBackgroundStyle = .sidebar with iPadOS 26.1 beta 2 (note the row
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’25
Reply to Checkbox in NSTableView
Is this table view cell-based or view-based?If it's cell-based, the content of a column is a NSCell. Replace the text field cell with a checkbox button cell.It it's view-based, you just delete the text field in the column and drag a checkbox in instead. However, you have to be very careful because the pieces are labelled confusingly.— Make sure you do not delete the text field NSCell that's at the first level under the column. It's something used internally by the table view— The other first level items within the column are alternative cell views. Unless you've added some, I think you'll find only one in a NSTableView columns. (NSOutlineView columns start with two.) That item is the NSTableCellView. Expand it, and you should see the actual text field. Delete this and put a checkbox in its place.If your table has all the standard IB item names, you should have gone down to Scroll View -> Clip View -> Table View -> Table Column -> Table
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’16
Reply to connecting windows and doors to a wall.
CapturedRoom.Surface has a transform simd_float4x4 and a dimensions simd_float3. The wall length is the dimensions.x and the position can be extracted from the transform with extension matrix_float4x4 { var position:SCNVector3 { return SCNVector3(columns.3.x, columns.3.y, columns.3.z) } } The Euler angles for the wall can be extracted using extension float4x4 { var eulerAngles: simd_float3 { simd_float3( x: asin(-self[2][1]), y: atan2(self[2][0], self[2][2]), z: atan2(self[0][1], self[1][1]) ) } }
Topic: App & System Services SubTopic: General Tags:
Jul ’22
Reply to Font Collection Column Missing
I reset Xcode using CleanMyMac, the font collection is now selecting English collection for me, where it stuck at Fixed Width previously, although, the collection column still hiding itself.I remember the last time I see the Font picker window is when I change the editor font, but I can't really remember the collection column is there or not.I try to install a fresh copy of Xcode (7.2.1) with another fresh OS X Yosemite 10.10.5/14F27 (with no xcode installed previously), the font collection column is there.Bug Report: 24608642
Feb ’16