MCPcopy Create free account
hub / github.com/PaulleDemon/PyUIBuilder / getGridStickyStyling

Function getGridStickyStyling

src/frameworks/customtk/widgets/base.js:257–275  ·  view source on GitHub ↗

* A simple function that returns a mapping for grid sticky tkinter

(sticky)

Source from the content-addressed store, hash-verified

255 * A simple function that returns a mapping for grid sticky tkinter
256 */
257 getGridStickyStyling(sticky){
258
259 const styleMapping = {
260 [GRID_STICKY.N]: { alignSelf: "start", justifySelf: "center" },
261 [GRID_STICKY.S]: { alignSelf: "end", justifySelf: "center" },
262 [GRID_STICKY.E]: { alignSelf: "center", justifySelf: "end" },
263 [GRID_STICKY.W]: { alignSelf: "center", justifySelf: "start" },
264 [GRID_STICKY.NS]: { alignSelf: "stretch", justifySelf: "center" }, // Stretch vertically
265 [GRID_STICKY.EW]: { alignSelf: "center", justifySelf: "stretch" }, // Stretch horizontally
266 [GRID_STICKY.NE]: { alignSelf: "start", justifySelf: "end" }, // Top-right
267 [GRID_STICKY.SE]: { alignSelf: "end", justifySelf: "end" }, // Bottom-right
268 [GRID_STICKY.NW]: { alignSelf: "start", justifySelf: "start" }, // Top-left
269 [GRID_STICKY.SW]: { alignSelf: "end", justifySelf: "start" }, // Bottom-left
270 [GRID_STICKY.NEWS]: { placeSelf: "stretch" } // Stretch in all directions
271 };
272
273 return styleMapping[sticky]
274
275 }
276
277 setParentLayout(layout){
278

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected