Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

Reply to NSTextView multiple columns
The general approach is outlined in the Cocoa Text Architecture Guide: Text System Organization – Common Configurations. Look for figure 3-5. You create the components of the text system separately, rather than just creating a text view and having it create the other components for you. You use a single text storage object, a single layout manager, and multiple text containers and text views. Each page-column is associated with a pair of text container and text view. You implement a delegate for the layout manager and implement -layoutManager:didCompleteLayoutForTextContainer:atEnd: to add additional columns and pages, along with their associated text containers and text views, as necessary to accommodate the text.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jun ’15
Reply to Remove gap between lazyvgrids in vstack
It's better to Paste as Paste and Match Style to avoid all the extra lines: 1. import SwiftUI 2. struct SecondView: View { 3. 4. var columns = [ 5. GridItem(.fixed(100), spacing: 0.1), 6. GridItem(.fixed(100), spacing: 0.1), 7. GridItem(.fixed(100), spacing: 0.1), 8. GridItem(.fixed(100), spacing: 0.1), 9. GridItem(.fixed(100), spacing: 0.1) 10. ] 11. let principalData: convertCSVtoArray 12. 13. var body: some View { 14. let numArrays = principalData.cvsData.count 15. let numElementsPerArray = principalData.cvsData[0].count 16. 17. VStack{ 18. Text() 19. Text(Historical Data) 20. .font(.title) 21. .padding(5) 22. Divider() 23. LazyVGrid( 24. columns: columns, 25. alignment: .center, 26. spacing: 0) 27. { 28. ForEach(0..<1) {row in 29. ForEach(0.. Could you post a screenshot to illustrate the problem ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Illegal NSTableViewDataSource
Hello Claude:func showRegisteredStudents() { guard (NSApplication.shared.delegate as? AppDelegate) != nil else { return } let managedContext = (NSApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let fetchRequest = NSFetchRequest(entityName: Registration) fetchRequest.returnsObjectsAsFaults = false fetchRequest.sortDescriptors = [NSSortDescriptor(key: lastName, ascending: true)] do { let readItems = try managedContext.fetch(fetchRequest) as! [NSManagedObject] print (There are (readItems.count) items) _ = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.persistentContainer.viewContext, sectionNameKeyPath: nil, cacheName: nil) // Configure Fetched Results Controller print(Records are (readItems)) items = readItems print(There are (items.count) items)// NOW items is filled self.tableView.reloadData() return() fatalError(Failed to fetch employees: (error)) } } } extension RegistrationReportsViewController: NSTableViewDataSource,NSTableViewDelegate{ // Da
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to How can I change the background color of a focused item of a NSTableView?
Here is a more simplified example of the app: import SwiftUI struct NSTableViewWrapper: NSViewRepresentable { class Coordinator: NSObject, NSTableViewDataSource, NSTableViewDelegate { var parent: NSTableViewWrapper init(parent: NSTableViewWrapper) { self.parent = parent } func numberOfRows(in tableView: NSTableView) -> Int { 1 } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { return NSTextField(labelWithString: Item) } func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] { return [NSTableViewRowAction(style: .destructive, title: Delete) { _, _ in }] } } func makeCoordinator() -> Coordinator { return Coordinator(parent: self) } func makeNSView(context: Context) -> NSScrollView { let scrollView = NSScrollView() let tableView = NSTableView() let column = NSTableColumn(identifier: NSUserInterfaceItemIdentifier(Column)) tableView.addTableColumn(column
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’25
Reply to CollectionView in TableView
But actually when i try to connect my ViewCollection with my ViewController, i recieve Error Outlets cannot be connected to repeating content. When i try to create it manualy, inside my function tableView(), the column which contains the ViewCollection isn't recognise.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’18