---
name: "Gtk2::Object"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::Object"
---

# Gtk2::Object(3pm)

wrapper for GtkObject

## NAME

Gtk2::Object - wrapper for GtkObject

## HIERARCHY

```
  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
```

## METHODS

### object = Gtk2::Object-\>new ($object\_class, ...)

- •

  `$object_class` (string) package name of object to create

- •

  ... (list) of property-name =\> value pairs

Create a new object of type *$object\_class*, with some optional initial property values.  You may see this used in some code as Gtk2::Widget-\>new, e.g.

```
 $window = Gtk2::Widget->new ('Gtk2::Window',
                              title => 'something cool',
                              allow_grow => TRUE);
```

This is really just a convenience function that wraps Glib::Object-\>new.

### boolean = $object-\>bindings\_activate ($keyval, $modifiers)

- •

  `$keyval` (integer)

- •

  `$modifiers` (Gtk2::Gdk::ModifierType)

Although `"activate"` and `"activate_event"` are `"Gtk2::Object"` methods, as of Gtk 2.12 binding sets are only associated with widgets so on an object as such the return is always false (no binding activated).

Further, although `"activate"` and binding sets are both expressed in terms of keyvals, internally the lookup is by keycode.  If a keyval cannot be generated by at least one keycode/modifier combination (see Gtk2::Gdk::Keymap) then it cannot be activated.  In particular this means keyvals like `"Pointer_Button1"` which are not actual keys cannot be dispatched by `"activate"` (returning false for no binding activated).

### boolean = $object-\>bindings\_activate\_event ($event)

- •

  `$event` (Gtk2::Gdk::Event)

Since: gtk+ 2.4

### $object-\>destroy

This is an explicit destroy --- NOT the auto destroy; Gtk2::Object inherits that from Glib::Object!

## PROPERTIES

- 'user-data' (gpointer : default 0 : readable / writable / private)

  Anonymous User Data Pointer

## SIGNALS

- **destroy** (Gtk2::Object)

  ## ENUMS AND FLAGS

### flags Gtk2::Gdk::ModifierType

- •

  'shift-mask' / 'GDK\_SHIFT\_MASK'

- •

  'lock-mask' / 'GDK\_LOCK\_MASK'

- •

  'control-mask' / 'GDK\_CONTROL\_MASK'

- •

  'mod1-mask' / 'GDK\_MOD1\_MASK'

- •

  'mod2-mask' / 'GDK\_MOD2\_MASK'

- •

  'mod3-mask' / 'GDK\_MOD3\_MASK'

- •

  'mod4-mask' / 'GDK\_MOD4\_MASK'

- •

  'mod5-mask' / 'GDK\_MOD5\_MASK'

- •

  'button1-mask' / 'GDK\_BUTTON1\_MASK'

- •

  'button2-mask' / 'GDK\_BUTTON2\_MASK'

- •

  'button3-mask' / 'GDK\_BUTTON3\_MASK'

- •

  'button4-mask' / 'GDK\_BUTTON4\_MASK'

- •

  'button5-mask' / 'GDK\_BUTTON5\_MASK'

- •

  'super-mask' / 'GDK\_SUPER\_MASK'

- •

  'hyper-mask' / 'GDK\_HYPER\_MASK'

- •

  'meta-mask' / 'GDK\_META\_MASK'

- •

  'release-mask' / 'GDK\_RELEASE\_MASK'

- •

  'modifier-mask' / 'GDK\_MODIFIER\_MASK'

## SEE ALSO

Gtk2, Glib::Object, Glib::InitiallyUnowned

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
