View Full Version : rowLayout alignments are OFF


DeadlyNightshade
08 August 2012, 01:50 PM
global proc setTexelDensity() {
string $windowTxDensity = `window
-title "Set Texel Density"
-iconName "setTxDens"
-w 420
-h 55
setTxDens `;

rowLayout
-numberOfColumns 5
-cw5 130 50 130 50 50
-cl5 "right" "left" "right" "left" "left";

text
-label "Texel Density (px/cm)";

floatField
-minValue 0
-precision 1
-step 1
Density;

text
-label "Texture Resolution (px)";

floatField
-minValue 0
-precision 1
-step 1
Resolution;

button
-label "Apply"
-c "applyScale";

setParent ..;
showWindow $windowTxDensity;
}
NONE of these elements follow the alignment set by the -cl5 -flag, and changing their width does not solve the problem. Why?

NaughtyNathan
08 August 2012, 04:17 PM
I can't actually test your code, but I'm guessing it's because you haven't used the "columnAttach" (-ct5) flag. It can't align them because you haven't "anchored" them to an edge.

DeadlyNightshade
08 August 2012, 04:41 PM
Makes sense - however it does not work: I added -ct5 with left alignments and it didnt change anything:
global proc setTexelDensity() {
string $windowTxDensity = `window
-title "Set Texel Density"
-iconName "setTxDens"
-w 420
-h 55
setTxDens `;

rowLayout
-numberOfColumns 5
-cw5 130 50 130 50 50
-cl5 "right" "left" "right" "right" "right"
-ct5 "left" "left" "left" "left" "left";

text
-label "Texel Density (px/cm)";

floatField
-minValue 0
-precision 1
-step 1
Density;

text
-label "Texture Resolution (px)";

floatField
-minValue 0
-precision 1
-step 1
Resolution;

button
-label "Apply"
-c "applyScale";

setParent ..;
showWindow $windowTxDensity;
}
http://img528.imageshack.us/img528/889/testyv.jpg
Text is still left aligned

NaughtyNathan
08 August 2012, 06:28 PM
yes, because that's ATTATCHMENT, not alignment. If you don't attach the control to BOTH sides how does it know where the center or the right is?

I agree it's not the most intuitive UI system in the world but it's fairly typical and makes sense as long as you know what the deal is...

CGTalk Moderation
08 August 2012, 06:28 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


1