---
name: "Gimp::basewidget"
section: "3pm"
platform: "linux"
package: "gimp1.2-perl"
version: "1.2.3-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/Gimp::basewidget"
---

# Gimp::basewidget(3pm)

pragma to declare the superclass of a gtk widget

## NAME

Gimp::basewidget - pragma to declare the superclass of a gtk widget

## SYNOPSIS

```
  use Gimp::basewidget 'superclass';
```

e.g.

```
  use Gimp::basewidget Gtk::Button;
```

## DESCRIPTION

This pragma can (but does not need to) be used to declare the current package as a childclass of an existing Gtk widget class. The only "import tag" must be the name of the existing superclass.

The module automatically registers a subtype, calls a special callback at gtk initialization time and provides default implementations for some common methods (the list might grow in the future to enhance settor/gettor functionality).

The following methods are provided. All of them can be overriden in your package.

- new

  A simple generic new constructor is provided. It will simply call `"Gtk::Object::new"` with all the provided arguments.

- GTK\_INIT

  This callback is called as early as possible *after* gtk was initialized, but not before. This can be used to register additional subtypes, argument types etc. It is similar to GTK\_CLASS\_INIT.

- GTK\_CLASS\_INIT

  Unlike the standard Gtk-callback of the same name, this method can be omitted in your package (while still being a valid Widget).

- GTK\_OBJECT\_INIT

  This callback can also be omitted, but this rarely makes sense ;)

## BUGS

This was a pain to implement, you will not believe this when looking at the code, though.

## AUTHOR

Marc Lehmann \<pcg@goof.com\>.

## SEE ALSO

[*perl*(1)](/perl/1.md), Gimp, Gimp::UI, Gtk.
