diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-31 14:39:04 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-31 14:39:04 (GMT) |
commit | 8c4a7c677d5be1b185c99a00fe1194e9b7c891fc (patch) | |
tree | ce536b27249d52c4097225310473a130890ff6b7 /generic/ttk | |
parent | e7d28b1b923c068ec111e4d0f2501593d2149f35 (diff) | |
download | tk-8c4a7c677d5be1b185c99a00fe1194e9b7c891fc.zip tk-8c4a7c677d5be1b185c99a00fe1194e9b7c891fc.tar.gz tk-8c4a7c677d5be1b185c99a00fe1194e9b7c891fc.tar.bz2 |
minor improvements to flag handling
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkEntry.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index c85751e..5d0a435 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1177,13 +1177,13 @@ static void EntryDisplay(void *clientData, Drawable d) textarea = Ttk_ClientRegion(entryPtr->core.layout, "textarea"); showCursor = - (entryPtr->core.flags & CURSOR_ON) != 0 + (entryPtr->core.flags & CURSOR_ON) && EntryEditable(entryPtr) && entryPtr->entry.insertPos >= leftIndex && entryPtr->entry.insertPos <= rightIndex ; showSelection = - (entryPtr->core.state & TTK_STATE_DISABLED) == 0 + !(entryPtr->core.state & TTK_STATE_DISABLED) && selFirst > -1 && selLast > leftIndex && selFirst <= rightIndex diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 15ceaa8..de9d795 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -791,7 +791,7 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) int side = 0; unsigned sideFlags = flags & _TTK_MASK_PACK; - while ((sideFlags & TTK_PACK_LEFT) == 0) { + while (!(sideFlags & TTK_PACK_LEFT)) { ++side; sideFlags >>= 1; } @@ -800,9 +800,11 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) } } - /* In Ttk_ParseLayoutTemplate, default -sticky is "nsew", - * so always include this even if no sticky bits are set. + /* + * In Ttk_ParseLayoutTemplate, default -sticky is "nsew", so always + * include this even if no sticky bits are set. */ + APPENDSTR("-sticky"); APPENDOBJ(Ttk_NewStickyObj(flags & _TTK_MASK_STICK)); |