Window buttons are not aligned

Window buttons are not aligned

jayantbhatt07
Advocate Advocate
878 Views
3 Replies
Message 1 of 4

Window buttons are not aligned

jayantbhatt07
Advocate
Advocate

Hi, I'm not able to align the buttons properly in the layout. Can anyone help me with that?

 

proc ScreenCaptureWin()
{
global string $rsTxtPath, $rsTxtName;
string $sn = `file -q -sn`;
string $cfp = `dirname( $sn )`;

if (`window -exists ScreenCapture`) //closes window if already open
deleteUI ScreenCapture;

window -title "ScreenCapture" ScreenCapture; //creates window

rowColumnLayout -numberOfColumns 3 -columnAttach 1 "right" 1 -columnWidth 10 10 -columnWidth 50 10;
text -label "Path";
$rsTxtPath = `textField -w 200 -h 28 -tx $cfp -ed true `;
button -w 60 -h 28 -label "Capture" -command "Capture";
rowColumnLayout -numberOfColumns 2 -columnAttach 1 "left" 1 -columnWidth 10 10 -columnWidth 10 10;
text -label "Name";
$rsTxtName = `textField -w 100 -h 28 -ed true `;

// show the window we last created
showWindow;;
}

 


global proc Capture()
{
global string $rsTxtPath;
global string $rsTxtName;

string $path = `textField -q -tx $rsTxtPath`;
string $FileName = `textField -q -tx $rsTxtName`;
string $rsFileList[] = `getFileList -folder $path`;
int $rsFileCount = size($rsFileList);
string $k = ($path + ("/"+$FileName+".jpg"));
string $ff = ".png";
string $node[] = `ls -sl`;
setAttr "defaultRenderGlobals.imageFormat" 8;
playblast -st 1 -et 1 -v 0 -fmt "image" -qlt 100 -p 100 -w 1000 -h 1000 -fp 0 -cf $k;
clear $node;
}

0 Likes
Accepted solutions (1)
879 Views
3 Replies
Replies (3)
Message 2 of 4

olarn
Advocate
Advocate
0 Likes
Message 3 of 4

jayantbhatt07
Advocate
Advocate
0 Likes
Message 4 of 4

jmreinhart
Advisor
Advisor
Accepted solution

At the moment you are creating a rowColumnLayout with three columns. That means all the widgets (text, textFields, buttons) that are created will be put into the next open spot in the layout (going from left to right then top to bottom).  

 

Path, textfield, and the capture button will become the first row in the layout.

 

Next you created another rowColumnLayout, this layout becomes the next item in the original rowColumnLayout. That means everything you add to that second rowColumnLayout will be squeezed into the first column of the second row.

 

The easiest solution is to just delete the line where you create the second rowColumnLayout then the "name text" and the "rsTextName" will become the first and second items in the second row and they will align with the first row nicely.

0 Likes