GtkWidget

Getting a descendant (child) widget by name

This script gets a descedant (child) widget by name using recursion. A name should be defined for the child previously, if not as a name is considered the class name.

The name is passed as a variable by reference, when the target is found it is stored in this variable.
This will change the variable type from string to object, this very information is used as a condition to stop further recursion.

Extending widgets with PHP

primitive widget

  • you need to extend GtkWidget
  • you need to write many methods
  • your constructor MUST NOT call parent::__construct, or you will have an error (Fatal error: Cannot instantiate abstract class) for primitive widgets (abstract ?) (GtkWidget),
<?php # simple code fragment (need to be completed) class PrimitiveWidget extends GtkWidget { function __construct() { # Fatal error: Cannot instantiate abstract class # PrimitiveWidget in line ... (__construct() line call)
Inhalt abgleichen