git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

Cocoa/GBTitledPopUpButton.m

      1 #import "GBTitledPopUpButton.h"
      2 
      3 @implementation GBTitledPopUpButton
      4 
      5 - (void)setDisplayTitle:(NSString *)displayTitle
      6 {
      7     if (!displayTitle) {
      8         ((NSPopUpButtonCell *)self.cell).usesItemFromMenu = true;
      9         ((NSPopUpButtonCell *)self.cell).menuItem = nil;
     10         return;
     11     }
     12     ((NSPopUpButtonCell *)self.cell).usesItemFromMenu = false;
     13     ((NSPopUpButtonCell *)self.cell).menuItem = [[NSMenuItem alloc] initWithTitle:displayTitle action:nil keyEquivalent:@""];
     14 }
     15 
     16 
     17 - (NSString *)displayTitle
     18 {
     19     return ((NSPopUpButtonCell *)self.cell).menuItem.title;
     20 }
     21 
     22 @end

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.