Gtk2::E...::Window(3)

πŸ“¦
version 0.67 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::E...::Window(3) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation and it's all about Gtk2::Ex::FormFactory::Window β€” yes the name is doing the absolute most, but stay with me, it's iconic. 🫢


✨ NAME ✨

Gtk2::Ex::FormFactory::Window β€” a Window in a FormFactory framework. that's it, that's the name, no notes. πŸ’…


🌸 SYNOPSIS 🌸

look at this little beauty:

Gtk2::Ex::FormFactory::Window->new (
  closed_hook   => Code reference to be called on window close,
  quit_on_close => Quit Gtk2 mainloop if windows is closed
  ...
  Gtk2::Ex::FormFactory::Container attributes
  Gtk2::Ex::FormFactory::Widget attributes
);

so you're constructing it, you're passing a closed_hook, you're passing quit_on_close, and then the ... is just vibes meaning "and also all the Container and Widget attributes, iykyk". πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so this class implements a Window inside a Gtk2::Ex::FormFactory framework. that's the whole job. the window title? it can be controlled by an associated application object. main character energy fr. πŸ‘‘

and here's the part that's genuinely so good: by default a Window automatically gets implemented with a VBox. which means β€” and this is the slay β€” you can add more than one widget to a Gtk2::Ex::FormFactory::Window, unlike with a plain old Gtk2::Window. one widget? in this economy?? no bestie, we're stacking them. 🧚

Note: if a window has a Gtk2::Ex::FormFactory parent, the FormFactory is closed automatically when the window gets destroyed. automatic cleanup, we love to see it. ✨

🌈 OBJECT HIERARCHY 🌈

here's the family tree, the lineage, the ancestry.com moment:

Gtk2::Ex::FormFactory::Intro

Gtk2::Ex::FormFactory::Widget
+--- Gtk2::Ex::FormFactory::Container
     +--- Gtk2::Ex::FormFactory::Window

Gtk2::Ex::FormFactory::Layout
Gtk2::Ex::FormFactory::Rules
Gtk2::Ex::FormFactory::Context
Gtk2::Ex::FormFactory::Proxy

see how Window is nested under Container which is nested under Widget? generational talent honestly. πŸ’€


πŸŽ€ ATTRIBUTES πŸŽ€

okay so attributes get handled through the common get_ATTR(), set_ATTR() style accessors β€” very standard, very demure. but they're mostly meant to be passed once to the object constructor, and you must not alter them after the associated FormFactory was built. set it and forget it, bestie. πŸ™ˆ

  • closed_hook = CODEREF [optional] β€” this code reference gets called when the window gets destroyed. like, for example, when the user closes the window using the window manager's close button, or when the program calls GtkWindow->destroy directly. if no closed_hook is set, an internal hook is connected which closes the Gtk2::Ex::FormFactory of this Window. so it's covered either way. 🫢
  • quit_on_close = BOOL [optional] β€” if this is set to true, the Gtk2 mainloop quits when the window is closed and no closed_hook is set. but if you do use a closed_hook, quitting the mainloop is up to you. your window, your rules. πŸ‘‘

🌟 AUTHORS 🌟

JΓΆrn Reder <joern at zyn dot de> β€” thank you for your service, legend. 🫑


Copyright 2004-2006 by JΓΆrn Reder.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. (no warranty bestie, none, zero, nada 😭)

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.


πŸ’€ POD ERRORS πŸ’€

not the doc having coding errors lmaooo. here's what went down:

Around line 109:

  • Non-ASCII character seen before =encoding in 'JΓΆrn'. Assuming UTF-8

the â said "I'm not explaining myself" and honestly? valid. 😭


and that's the whole page, bestie! this one shipped with perl v5.42.0, dated 2025-07-25 β€” go forth and build windows with multiple widgets, you absolute icon πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from