Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Custom font for ui.SegmentedControl
-
Hi how can I set a custom font for ui.SegmentedControl instance?
Objective C hackery?Cheers!
Rich -
@rb this works
import ui from objc_util import * v = ui.SegmentedControl() v.frame =(0,0,300,50) v.segments = ['one','two'] UIFont = ObjCClass('UIFont').fontWithName_size_('Menlo', 32) #UIFont = ObjCClass('UIFont').systemFontOfSize(32) red = UIColor.redColor() attributes = {'NSFont': UIFont, 'NSColor': red} vo= ObjCInstance(v).segmentedControl() vo.setTitleTextAttributes_forState_(attributes, 0) v.present('sheet')
-
Thanks works perfectly:)