From: Enlightenment C. <no...@cv...> - 2007-10-14 14:07:54
|
Enlightenment CVS committal Author : leviathan Project : e17 Module : libs/etk-perl Dir : e17/libs/etk-perl/lib Modified Files: Etk.pm Log Message: Rework Combobox items to make use of new empty functions. Also added utility functions to Etk.pm so that users don't have to manually call FieldsSet, they can continue to use the same old syntax and all conversion is done automatically =================================================================== RCS file: /cvs/e/e17/libs/etk-perl/lib/Etk.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- Etk.pm 3 Jul 2007 19:26:05 -0000 1.26 +++ Etk.pm 14 Oct 2007 14:07:22 -0000 1.27 @@ -28,6 +28,53 @@ push @{$col->{_models}}, $model->{_model}; } +package Etk::Combobox; + +sub ItemAppend { + my $self = shift; + my $item = $self->ItemAppendEmpty(); + $item->FieldsSet(@_) if @_; + return $item; +} + +sub ItemPrepend { + my $self = shift; + my $item = $self->ItemPrependEmpty(); + $item->FieldsSet(@_) if @_; + return $item; +} + +sub ItemInsert { + my $self = shift; + my $after = shift; + my $item = $self->ItemInsert($after); + $item->FieldsSet(@_) if @_; + return $item; +} + +package Etk::Combobox::Entry; + +sub ItemAppend { + my $self = shift; + my $item = $self->ItemAppendEmpty(); + $item->FieldsSet(@_) if @_; + return $item; +} + +sub ItemPrepend { + my $self = shift; + my $item = $self->ItemPrependEmpty(); + $item->FieldsSet(@_) if @_; + return $item; +} + +sub ItemInsert { + my $self = shift; + my $after = shift; + my $item = $self->ItemInsert($after); + $item->FieldsSet(@_) if @_; + return $item; +} 1; __END__ |