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

Function getGridStickyStyling

src/frameworks/tkinter/widgets/base.js:255–273  ·  view source on GitHub ↗

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

(sticky)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected