PDL::G...ontrol(3pm)

πŸ’… NAME πŸ’…

PDL::Graphics::TriD::ButtonControl β€” the default event handler subroutines, bestie. the lil' base-class bouncer that decides what happens when you click stuff in TriD πŸ’–


πŸŽ€ FUNCTIONS πŸŽ€

okay so this is the whole toolbox. there's like five things and honestly they're all kinda chill.

✨ new() ✨

Blesses an object into the class ButtonControl, and it expects the associated Window object to be supplied as an argument. like, hand it the window, it hands you back a blessed lil' guy. that's the deal. 🫢

the lore: ButtonControl is a base class which all TriD event controllers should inherit from. periodt. it's the blueprint, the blueprint of blueprints, the mother of all click-handlers.

but lowkey? by itself it does not do much. it's giving "placeholder queen". πŸ‘‘

what it does do: it defines the ButtonPress and ButtonRelease functions, which are the ones the Event loop is expecting to find. so if you inherit from it, the Event loop won't be out here screaming at you. it's the bare minimum and it's iconic for it. πŸ’€

πŸ¦‹ mouse_moved πŸ¦‹

a do-nothing function, and no that's not a read β€” its whole job is to prevent errors if it's not defined in a subclass. it's the emotional support no-op. nothing happens, and that's on purpose. 😌

🌸 ButtonRelease 🌸

a do-nothing function to prevent errors if not defined in a subclass. same energy as mouse_moved, different moment in time. you let go of the mouse, it does... nothing. beautifully. πŸ’–

πŸ”₯ ButtonPress πŸ”₯

okay this one actually does something!! it activates the viewport the mouse is inside when pressed. so you click inside a viewport, that viewport wakes up and becomes the main character. main character energy, literally. πŸ‘‘

⭐ set_wh ⭐

defines the width and Height of the window for button control. that's it, that's the function. it sets the w and the h so the button control knows how big the playground is. πŸŽ€


ngl the whole point of this module is: inherit from it, define the fun stuff in your subclass, and let the base class handle the "don't crash" duties. no cap. ✨

and that's the page, bestie!! this lil' writeup came to you from the User Contributed Perl Documentation squad, running on perl v5.40.1, dated 2025-04-11, and filed under the very mysterious name PDL::G...ontrol(3pm) πŸ’… mwah, go click something 🫢🌈

πŸ“¦ where this page comes from