Beispiel #1
0
        internal static NSButton CreateButton(string text, NSBezelStyle bezelStyle)
        {
            NSButton result = new NSButton();

            result.Title      = text;
            result.BezelStyle = bezelStyle;

            return(result);
        }
Beispiel #2
0
        public static NSButton CreateButton(NSBezelStyle bezelStyle, NSFont font, string text, NSControlSize controlSize = NSControlSize.Regular, NSImage image = null, bool bordered = true)
        {
            var button = new NSButton
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BezelStyle  = bezelStyle,
                Bordered    = bordered,
                ControlSize = controlSize,
                Font        = font ?? GetSystemFont(false),
                Title       = text
            };

            if (image != null)
            {
                button.Image = image;
            }

            return(button);
        }