Mercurial > dwindows
comparison ios/dw.m @ 2421:d88928a85436
iOS: Fix DWMLE, have to created it like this to have valid textStorage.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 03 Apr 2021 21:25:25 +0000 |
parents | 384d076ed52a |
children | 4a353a83b2e4 |
comparison
equal
deleted
inserted
replaced
2420:384d076ed52a | 2421:d88928a85436 |
---|---|
4421 DW_FUNCTION_RETURN(dw_mle_new, HWND) | 4421 DW_FUNCTION_RETURN(dw_mle_new, HWND) |
4422 DW_FUNCTION_RESTORE_PARAM1(cid, ULONG) | 4422 DW_FUNCTION_RESTORE_PARAM1(cid, ULONG) |
4423 { | 4423 { |
4424 CGRect frame = CGRectMake(0, 0, 100, 50); | 4424 CGRect frame = CGRectMake(0, 0, 100, 50); |
4425 NSTextContainer *tc = [[NSTextContainer alloc] initWithSize:frame.size]; | 4425 NSTextContainer *tc = [[NSTextContainer alloc] initWithSize:frame.size]; |
4426 NSLayoutManager *lm = [[NSLayoutManager alloc] init]; | |
4427 NSTextStorage *ts = [[NSTextStorage alloc] init]; | |
4428 [lm addTextContainer:tc]; | |
4429 [ts addLayoutManager:lm]; | |
4426 DWMLE *mle = [[[DWMLE alloc] initWithFrame:frame textContainer:tc] retain]; | 4430 DWMLE *mle = [[[DWMLE alloc] initWithFrame:frame textContainer:tc] retain]; |
4427 CGSize size = [mle intrinsicContentSize]; | 4431 CGSize size = [mle intrinsicContentSize]; |
4428 | 4432 |
4429 size.width = size.height; | 4433 size.width = size.height; |
4430 [mle setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; | 4434 [mle setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth]; |