entry: add text selection abilities. macos part
This commit is contained in:
parent
0a2cfd1238
commit
dde2483e93
|
@ -178,6 +178,17 @@ void uiEntrySetText(uiEntry *e, const char *text)
|
||||||
// don't queue the control for resize; entry sizes are independent of their contents
|
// don't queue the control for resize; entry sizes are independent of their contents
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uiEntrySelectText(uiEntry *e, int start, int end)
|
||||||
|
{
|
||||||
|
NSRange range = {start, end - start};
|
||||||
|
[e->textfield.currentEditor setSelectedRange:range];
|
||||||
|
}
|
||||||
|
|
||||||
|
void uiEntrySelectAllText(uiEntry *e)
|
||||||
|
{
|
||||||
|
[e->textfield selectText:cWindow];
|
||||||
|
}
|
||||||
|
|
||||||
void uiEntryOnChanged(uiEntry *e, void (*f)(uiEntry *, void *), void *data)
|
void uiEntryOnChanged(uiEntry *e, void (*f)(uiEntry *, void *), void *data)
|
||||||
{
|
{
|
||||||
e->onChanged = f;
|
e->onChanged = f;
|
||||||
|
|
Loading…
Reference in New Issue