Gtk2::E...::Proxy(3)

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

πŸ’– Gtk2::Ex...::Proxy(3) πŸ’–

okay bestie, gather round β€” this is the manual page for Gtk2::Ex::FormFactory::Proxy, straight outta the User Contributed Perl Documentation section. It's giving "quiet little class that does a LOT of heavy lifting." Let's get into it. πŸ¦‹


✨ NAME ✨

Gtk2::Ex::FormFactory::Proxy β€” the proxy class for application objects. That's it, that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#-- Proxies are always created through
#-- Gtk2::Ex::FormFactory::Context, never
#-- directly by the application.

Gtk2::Ex::FormFactory::Proxy->new (
  context              => Gtk2::Ex::FormFactory::Context,
  object               => Object instance or CODEREF,
  name                 => Name of this proxy,
  set_prefix           => Method prefix for write accessors,
  get_prefix           => Method prefix for read accessors,
  attr_accessors_href  => Hashref with accessor callbacks,
  attr_activity_href   => Hashref with activity callbacks,
  aggregated_by        => Fully qualified attribute of the parent,
  changes_attr_filter  => Regex for attributes which should not trigger
                          the object's 'changed' status
);
🚨 bestie listen: those comments at the top are NOT a suggestion. You do not make these yourself. The Context does it for you. Respect the pipeline. πŸ™ˆ

πŸŽ€ DESCRIPTION πŸŽ€

So like… this class implements a generic proxy mechanism for accessing application objects and their attributes. It defines how attributes of the associated object are accessed. ✨

And here's the thing β€” you never instantiate objects of this class by yourself. They're created internally by Gtk2::Ex::FormFactory::Context when you add objects with the Context->add_object() method. It's giving "backstage crew, main character energy." πŸ‘‘

But! You may use the proxy objects, like, for updates which affect the application object and the GUI as well. Two birds, one slay. 🐦🐦

You can receive Proxy objects using the Gtk2::Ex::FormFactory::Context->get_proxy() method. Go get 'em. 🫢


🧚 OBJECT HIERARCHY 🧚

Gtk2::Ex::FormFactory::Proxy

Just the one. A solo act. A standalone icon. ⭐


πŸ’œ ATTRIBUTES πŸ’œ

Attributes are handled through the common get_ATTR(), set_ATTR() style accessors. Very consistent of them, honestly. 😌

  • context = Gtk2::Ex::FormFactory::Context [mandatory] β€” The Context this proxy belongs to. Required, no cap. πŸ”₯
  • object = Object instance | CODEREF β€” The application object itself, or a code reference which returns the object instance. Either works, it's flexible like that. πŸ’«
  • name = SCALAR [mandatory] β€” The Context-wide unique name of this Proxy. Yes, Context wide unique. Don't be out here duplicating names. 😭
  • set_prefix = SCALAR [optional] β€” This is the method prefix for write accessors. Defaults to set_. So original. So classic.
  • get_prefix = SCALAR [optional] β€” This is the method prefix for read accessors. Defaults to get_. The matching set, we love a duo. 🫢
  • attr_accessors_href = HASHREF [optional] β€” With this hash you can override specific accessors with a code reference, which is called instead of the object's own accessor. Custom behaviour, we stan.

Refer to Gtk2::Ex::FormFactory::Context->add_object for details.

  • attr_activity_href = HASHREF [optional] β€” This hash defines callbacks for attributes which return the activity state of the corresonding attribute.

Refer to Gtk2::Ex::FormFactory::Context->add_object for details.

  • aggregated_by = "object.attr" [optional] β€” Fully qualified attribute of the parent aggregating this object.

Refer to Gtk2::Ex::FormFactory::Context->add_object for details.

  • changes_attr_filter = REGEX [optional] β€” Refer to Gtk2::Ex::FormFactory::Context->add_object for details.
  • object_changed = BOOLEAN β€” This flag indicates whether the object represented by this Proxy was changed. You may set this attribute to reset the object's changed state. ✨ Resetting? Groundbreaking. πŸ’…

🌈 METHODS 🌈

  • $app_object = $proxy->get_object () β€” This returns the actual application object of this Proxy β€” either the statical assigned instance, or a dynamicly retrieved instance. Either way you get the object. 😌
  • $proxy->set_object ($object) β€” Changes the application object instance in this Proxy. All dependend Widgets on the GUI are updated accordingly. Everything stays in sync, as it should. πŸ”„
  • $app_object_attr_value = $proxy->get_attr ($attr) β€” Returns the application object's attribute $attr of this Proxy.

If $attr has the form "object.attr" the attribute of the correspondent object is retreived, instead of the object associated with this proxy. Sneaky little path traversal, love that for you. πŸ¦‹

  • $proxy->set_attr ($attr => $value) β€” Changes the application object's attribute $attr to $value and updates all dependend Widgets on the GUI accordingly.

If $attr has the form "object.attr" the correspondent object will be updated, instead of the object associated with this proxy.

  • $proxy->set_attrs ( { $attr => $value, ... } ) β€” Changes a bunch of application object's attributes, which is passed as a hash reference with $attr => $value pairs, and updates all dependend Widgets on the GUI accordingly. Bulk mode. Efficiency queen. πŸ‘‘
  • $activity = $proxy->get_attr_activity ($attr) β€” Returns the current activity state of $attr. That's the whole thing. Short and iconic. ⭐

πŸ‘‘ AUTHORS πŸ‘‘

JΓΆrn Reder <joern at zyn dot de>


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.

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.

πŸ’€ bestie the ALL-CAPS warranty disclaimer is doing the most but it is FR FR serious. No promises, no guarantees, ship at your own risk.

πŸ™ˆ POD ERRORS πŸ™ˆ

Hey! The above document had some coding errors, which are explained below:

  • Around line 470:
    • Expected text after =item, not a bullet
  • Around line 476:
    • Non-ASCII character seen before =encoding in 'JΓΆrn'. Assuming UTF-8
😭 not the POD parser catching strays. Jârn's name said "I contain multibyte" and podchecker said "excuse me?"

okay that's the whole page, you're officially a Proxy understander now. go forth and never call ->new on it directly, I'm begging. πŸ’–βœ¨

this little manual lives in perl v5.42.0, dated 2025-07-25 β€” tysm for reading, mwah, bye bestie! πŸ«ΆπŸŒΈπŸ’…

πŸ“¦ where this page comes from