summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-07-31 14:39:04 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-07-31 14:39:04 (GMT)
commit8c4a7c677d5be1b185c99a00fe1194e9b7c891fc (patch)
treece536b27249d52c4097225310473a130890ff6b7 /generic/ttk
parente7d28b1b923c068ec111e4d0f2501593d2149f35 (diff)
downloadtk-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.c4
-rw-r--r--generic/ttk/ttkLayout.c8
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));