zoukankan      html  css  js  c++  java
  • NSTableView系列之代码创建(不用nib)

    // create a table view and a scroll view
    NSScrollView * tableContainer = [[NSScrollView alloc] initWithFrame:NSMakeRect(10, 10, 380, 200)];
    NSTableView * tableView = [[NSTableView alloc] initWithFrame:NSMakeRect(0, 0, 364, 200)];
    // create columns for our table
    NSTableColumn * column1 = [[NSTableColumn alloc] initWithIdentifier:@"Col1"];
    NSTableColumn * column2 = [[NSTableColumn alloc] initWithIdentifier:@"Col2"];
    [column1 setWidth:252];
    [column2 setWidth:198];
    // generally you want to add at least one column to the table view.
    [tableView addTableColumn:column1];
    [tableView addTableColumn:column2];
    [tableView setDelegate:self];
    [tableView setDataSource:self];
    [tableView reloadData];
    // embed the table view in the scroll view, and add the scroll view to our window.
    [tableContainer setDocumentView:tableView];
    [tableContainer setHasVerticalScroller:YES];
    [[self contentView] addSubview:tableContainer];
  • 相关阅读:
    AcWing 143. 最大异或对
    分组异或
    Java面向对象的思维导图
    数组中超过一半的元素
    SQL带事务的存储过程添加功能
    分页存储过程MYSQL
    文件夹的压缩
    邮箱发送文件
    SQL万能存储过程分页
    Api反射泛型添加
  • 原文地址:https://www.cnblogs.com/weilaikeji/p/2975041.html
Copyright © 2011-2022 走看看