wxGridSizer(3erl)

🌸 wxGridSizer (3erl) 🌸

okay bestie so this is the Erlang module definition for wxGridSizer β€” yes it's a real Erlang thing, no I'm not kidding, and yes it's giving very much "I make your UI look like a spreadsheet but make it fashion" πŸ’…


✨ NAME ✨

wxGridSizer β€” literally just functions for the wxGridSizer class. that's the whole name. iconic, minimal, ate. πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: a grid sizer is a sizer that lays out its children in a two-dimensional table where every single field is the same size. like a group chat where everyone gets an equal amount of space and nobody's hogging the spotlight 🫢

and how does it pick that size? lowkey simple:

  • the width of each field is the width of the widest child πŸ’ͺ
  • the height of each field is the height of the tallest child πŸ“

so the biggest kid in the room sets the standard for everybody. main character energy fr fr πŸ‘‘

see: wxSizer, Overview sizer

this class is derived (and can use functions) from: wxSizer β€” so it inherited everything and honestly it's thriving 🌈

wxWidgets docs: wxGridSizer β€” go read the source material bestie, iykyk πŸ“š


πŸ¦‹ DATA TYPES πŸ¦‹

wxGridSizer() = wx:wx_object()

that's it. that's the data type. it's just a wx object and we respect it for that πŸ’œ


πŸ‘‘ EXPORTS πŸ‘‘

⭐ new(Cols) -> wxGridSizer()

Types:

Cols = integer()

make a fresh new sizer with Cols columns. sparkly and new, no cap ✨

⭐ new(Cols, Options :: [Option]) -> wxGridSizer()

Types:

Cols = integer()
Option = {gap, {W :: integer(), H :: integer()}}

same deal but now you get an options list, and the option is {gap, {W, H}} where W and H are integers. put some breathing room between your cells bestie, they deserve it πŸ“

⭐ new(Cols, Vgap, Hgap) -> wxGridSizer()

(no explicit types block on this one, it's mysterious like that πŸ™ˆ)

three args: Cols, Vgap, Hgap. vertical gap, horizontal gap, all the gaps. gap game strong 😭

⭐ new(Rows, Cols, Gap) -> wxGridSizer()

Types:

Rows = Cols = integer()
Gap = {W :: integer(), H :: integer()}

now you're specifying Rows and Cols, plus a single Gap tuple {W, H}. a full-on grid, fully booked, no vacancies πŸŽ€

⭐ new(Rows, Cols, Vgap, Hgap) -> wxGridSizer()

Types:

Rows = Cols = Vgap = Hgap = integer()

four integers, maximum control, Rows, Cols, Vgap, Hgap. this is the deluxe version and honestly? obsessed πŸ’…


πŸ’– getCols(This) -> integer()

Types:

This = wxGridSizer()

returns the number of columns that have been specified for the sizer.

heads up bestie: it returns zero if the sizer is automatically adjusting the number of columns depending on the number of its children 😳

and if you want the effective number of columns or rows being currently used? that's GetEffectiveColsCount() β€” but plot twist, not implemented in wx πŸ’€ so don't come for me, it's just not there.

🌸 getHGap(This) -> integer()

Types:

This = wxGridSizer()

returns the horizontal gap (in pixels) between cells in the sizer. that's the side-to-side personal space πŸ‘‰πŸ‘ˆ

🧚 getRows(This) -> integer()

Types:

This = wxGridSizer()

returns the number of rows that have been specified for the sizer.

again: returns zero if the sizer is auto-adjusting the number of rows based on how many children it has πŸ™ˆ

want the effective count? that's GetEffectiveRowsCount() β€” and nope, not implemented in wx. we suffer together 😭

πŸ’œ getVGap(This) -> integer()

Types:

This = wxGridSizer()

returns the vertical gap (in pixels) between the cells in the sizer. up-and-down breathing room, we stan 🌬️


πŸŽ€ setCols(This, Cols) -> ok

Types:

This = wxGridSizer()
Cols = integer()

sets the number of columns in the sizer. you're in charge now πŸ‘‘

πŸ”₯ setHGap(This, Gap) -> ok

Types:

This = wxGridSizer()
Gap = integer()

sets the horizontal gap (in pixels) between cells in the sizer. spread them out a lil, let them vibe πŸ¦‹

🌈 setRows(This, Rows) -> ok

Types:

This = wxGridSizer()
Rows = integer()

sets the number of rows in the sizer. stack 'em up ⭐

πŸ“ setVGap(This, Gap) -> ok

Types:

This = wxGridSizer()
Gap = integer()

sets the vertical gap (in pixels) between the cells in the sizer. vertical space is self care fr fr πŸ’†β€β™€οΈ


πŸ’€ destroy(This :: wxGridSizer()) -> ok

destroys the object. rip to it honestly, it served its purpose 🫑✨


and that's the whole page bestie, no notes, go build something cute with your uniform grid πŸŽ€πŸ’–

~ cute lil sign-off ~ brought to you by the wxWidgets team, and this particular page is from wx 2.2.2.1 β€” from me and the grid sizer, mwah πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from