Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

Reply to Hide/Show tableview columns?
Did you already succeed to hide only the current column ? You should use func tableView(NSTableView, mouseDownInHeaderOf: NSTableColumn) Which tells the delegate that the mouse button was clicked in the specified table column’s header. Note: do you intend to do multiple selection in the popup ? May be not the best UI option. Why not a popover where to select the columns ? In this func, you can test for right click before calling popup. To change width of a column: let zeroWidth = 0.0 self.tableView.tableColumns[column].width = zeroWidth
Aug ’20
Reply to Safari does better than Firefox, but better isn’t good.
Another issue: If --count is set to 1 as result of round: --count: calc(round(down, calc(sqrt(var(--images))), 1) + 1); grid-template-columns: repeat(var(--count), 1fr); grid-template-columns: 1fr; isn’t the same (in Safari)! The first line results in 2 columns, not in one! Looks like the same reason. Because grid-template-columns: repeat(calc(var(--count) -0.01), 1fr); gives one column.
Topic: Safari & Web SubTopic: General Tags:
May ’23
NSTableView binding, column Header Title is readonly, workaround or alternative?
I am currently working on a MacOS project (Swift 4, Xcode 9) to shows different sets of data in one NSTableView, users can add, delete, and move around their created data sets, and everything is bound to core data through two array controllers via the NSTableView's bindings inspector sections (one to many between the column data entity and title/presets entity)Unfortunately, the Header Title binding seems to be in the Column -> Binding inspector -> Parameter section, and is read only (based on Apple documentation).https://developer.apple.com/library/content/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSTableColumn.html#//apple_ref/doc/uid/NSTableColumn-SW48As I've also implemented a custom TableHeaderCell class that allows the editing of the column's Header titles (field editor call in the NSTableView double click method), even if the cell is updated via the custom class, the header title binding will not update the array controller or core data.Custom NSTableH
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
1.1k
Oct ’17
Reply to How to frozen a few columns for NSTableView
In the Width inspector (Command-Option-5), set the column's width, minimum and maximum all to the same value.Then, in the Attributes inspector for the table, make sure the Column Sizing menu is set to something other than First Column Only, depending how you want the rest of the columns to resize.
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’16
Reply to Peculiar EXC_BAD_ACCESS, involving sparse matrices
the sparseMatrix function with comments: extension Array where Element == [Double] { // A sparse matrix is a mattrix where all zero's are ommitted. // Normal matrix: Sparse matrix: // 0 1 0 1 // 1 3 0 1 3 // 4 0 2 4 2 // Find the sparse matrix of this matrix. Returns an array of doubles containing the values of the sparse matrix (omitting all zero's) and a SparseMatrixStructure containing information about where the columns start and where the rows start. The values array of the sparse matrix above would be [1, 4, 1, 3, 2]. func sparseMatrix() -> (structure: SparseMatrixStructure, values: [Double]) { let columns = self.transpose() // Get the row indices of the matrix. The row indices of the sparse matrix above would be // [1, 2 column 0 // 0, 1, column 1 // 2] column 2 var rowIndices: [Int32] = columns.map { column in column.indices.compactMap { indexInColumn in if column[indexInColumn] != 0 { return Int32(indexInColumn) } return nil } }.reduce
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’24
Apple News Format 2 column container with different widths
https://developer.apple.com/documentation/apple_news/collection_display#see-alsoHi, I have a container using the following with a nested image and text component that both take 50% of the width of the container which is great for mobile, but for tablet, I'd like to be able to specify the maxwidth of only the image so that it takes 30% or a column span of 3 for larger displays. Does anyone know how to achieve that type of layout?contentDisplay: { type: collection, gutter: 15, rowSpacing: 30, distribution: wide, variableSizing: true }thanks!
0
0
627
Oct ’18
Reply to Help Loading an External CSV File on iOS in Swift
I was able to load a CSV into a TabularData based SwiftUI app -- loading and displaying was no issue ... but, HOW to update a value in a column. I created a bindable textfield for the columns in the table, and it displays the value for the rows/columns, and while the code to update the column compiles, it never updates the value in the DataFrame. Is a DataFrame read only ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to NSPersistentCloudKitContainer - how to reset CoreData+CloudKit after failed automatic migration (while still in development environment)
Additional info to my questions above: even if I delete the app from the test device reset the Development Environment in the CloudKit dashboard for my apps container then reinstall the app out of Xcode the same skipping migration error shows up in the console. This does not make sense to me. Why after all CoreData DBs on test device(s) have been cleared and newly compiled code has been installed on device. Shouldn't Xcode use the current NSManagedObjectModel as the new zero generation model, and thus not need any migration!? What do I miss here? Or is this a CoreData bug? P.S. the log shows these lines: Skipping migration for 'ANSCKMETADATAENTRY' because it already has a column named 'ZDATEVALUE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSUPLOAD' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column named 'ZNEEDSLOCALDELETE' Skipping migration for 'ANSCKRECORDMETADATA' because it already has a column nam
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21
Reply to Converting json to html table
Try to avoid things like NSArray if you're writing new Swift code. Be explicit about your types whenever possible.print(<table><thead>) if let columns = json[columns] as? [[String : String]] { for column in columns { let label = column[label]! print(<th>(label)</th>) } } print(</thead><tbody>) if let rows = json[rows] as? [[String : [String]]] { for row in rows { print(<tr>) for value in row[values]! { print( <td>(value)</td>, terminator: ) } print(</tr>) } } print(</tbody></table>)
Oct ’15
Reply to Sorting NSTableView
Setting the sort descriptor prototype of a table column allows the column to inform the table view of how it should be sorted when the user clicks that column's header. (Again, the table view isn't able to sort itself, but it informs the data source or, if so bound, its array controller, which sorts the data.)It also allows the table view to show an indicator in the header of the primary-sorting column.If your table doesn't have headers or will only ever have one column or isn't otherwise user-sortable, then you don't need to set the column's sort descriptor prototype.
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’15
Matrix - Buffer, row - column representation problem
Greeting,I represent my matrix buffer with the following data on the GPU:Address: Data:0x00 0 1 2 30x01 4 5 6 70x02 8 9 10 110x03 12 13 14 15With the following shading code:float4 (out) = float4x4 (m) * float4 (in)According to apple's documentationfloat3 u = m * v;is equivalent to:u = v.x * m[0];u += v.y * m[1];u += v.z * m[2];My question is does m[0] refer to <0, 1, 2, 3> or <0, 4, 8, 12>?As my experiment shows the GPU does compute the matrix as m[0] = <0, 1, 2, 3>But common sense tell us m[0] should be the column <0, 4, 8, 12> otherwise it's very hard to read and debugIf m[0] did refer to <0, 1, 2, 3>, is there any way to transpose a matrix in shading file?Or we have to work on transposed matrix all the time?Thanks!
3
0
2.4k
Nov ’15
Reply to Create array of arrays by two properties
That's pretty similar to what I was already doing. I ended up finalizing on this, which will be easier to understand in the future. var prevColumn = sorted[0].column var startIndex = 0 var byColumnAndRow: [[Match]] = [] for (index, match) in sorted.enumerate() { guard prevColumn != match.column else { continue } let column = Array(sorted[startIndex ..< index]) byColumnAndRow.append(column) startIndex = index prevColumn = match.column } // The previous enumeration won't grab the very last column worth of matches because the // loop ends before the column changes again. byColumnAndRow.append(Array(sorted[startIndex ..< sorted.count]))
Feb ’16
NSBrowser Column Resizing Causes NSWindowWillStartLiveResizeNotification to be posted even though the window isn't being resized.
I have an NSBrowser inside a window. When I start resizing a column I noticed a peculiar behavior: it causes NSWindowWillStartLiveResizeNotification to get posted for the NSWindow the browser is inside (and did end gets posted when column resizing finishes). The browser is not the NSWindow contentView but a descendant of the contentView. I have my reasons for caring (I'm currently listening for these window resize notifications) but my code naively assumes that NSWindowWillStartLiveResizeNotification - NSWindowDidEndLiveResizeNotification indicates a window resizing session, not a column resizing session for the NSBrowser. This is in contrast to NSOutlineView. When resizing columns in NSOutlineView the window resize notifications do not get posted. NSBrowser deliberately kicks it off: -[NSWindow _startLiveResize]; -[NSBrowser _resizeColumn:withEvent:] () So this seems quite intentional but is it necessary in modern macOS? Should I file a bug? I already did FB20298148
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
116
Sep ’25