NAME

Etk::Simple - Simplified function calls for Etk

SYNOPSIS

use Etk::Simple;
use Etk::Stock qw/:all/;

my $button = Etk::Button->new();
my $button_with_label = Etk::Button->new("This is a label");
my $button_from_stock = Etk::Button->new(DocumentNew);

DESCRIPTION

Many widgets in Etk have different constructors and require different calls for each type of constructor.

This module tries to simplify this process by providing a single "new" constructor that, depending on the number and type of arguments, calls the required C constructor.

OVERLOADED WIDGETS

The following are the widgets that have had their constructors overloaded. For each widget we list the type/number of arguments it accepts

Etk::Button

undef - creates an empty button
string - creates a button with a label
number - creates a button from stock

Etk::CheckButton

undef - creates an empty checkbutton
string - creates a checkbutton with a label

Etk::Image

undef - creates an empty image
number,number - creates an image from stock with a stock size
string,string - creates an image from edje with key
string - creates an image from file

Etk::Menu::Item

undef - creates empty menu item
number - creates menu item from stock
string - creates menu item with label

Etk::Menu::Item::Check

undef - creates empty menu item
string - creates menu item with label

Etk::Menu::Item::Image

undef - creates empty menu item
number - creates menu item from stock
string - creates menu item with label

Etk::Menu::Item::Radio

undef - creates empty menu item
object - creates menu item from the specified object
string - creates menu item with label
string,object - creates menu item with label from the specified object

Etk::ProgressBar

undef - creates empty progressbar
string - creates a progressbar with text

Etk::RadioButton

undef - creates empty radio button
object - creates radio button from the specified object
string - creates radio button with label
string,object - creates radio button with label from the specified object

Etk::ToolButton

undef - creates empty tool button
number - creates tool button from stock
string - creates tool button with label

Etk::ToolToggleButton

undef - creates empty tool togglebutton
number - creates tool togglebutton from stock
string - creates tool togglebutton with label

Etk::ToggleButton

undef - creates empty togglebutton
number - creates togglebutton from stock
string - creates togglebutton with label

NOTES

Since this module redefines the new() subroutines, it includes a `no warnings 'redefine'` to remove warnings.

AUTHOR

Chady 'Leviathan' Kassouf, <chady.kassouf@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Chady Kassouf

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.