ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/gtk.pl
(Generate patch)

Comparing kgsueme/kgsueme/gtk.pl (file contents):
Revision 1.32 by root, Wed Jun 2 09:32:32 2004 UTC vs.
Revision 1.33 by root, Wed Jun 2 13:38:53 2004 UTC

224 $widget->signal_connect (clicked => sub { $cb->() if $cb }); 224 $widget->signal_connect (clicked => sub { $cb->() if $cb });
225 225
226 $widget; 226 $widget;
227} 227}
228 228
229package gtk::widget;
230
231# hacked gtk pseudo-widget
232
233sub new {
234 my $class = shift;
235 bless { @_ }, $class;
236}
237
238sub widget { $_[0]{widget} }
239
240sub AUTOLOAD {
241 $AUTOLOAD =~ /::([^:]+)$/ or Carp::confess "$AUTOLOAD: no such method (illegal name)";
242 ref $_[0]{widget} or Carp::confess "AUTOLOAD: non-method call $AUTOLOAD(@_)\n";
243 my $method = $_[0]{widget}->can ($1)
244 or Carp::confess "$AUTOLOAD: no such method";
245 # do NOT cache.. we are fats enough this way
246 unshift @_, shift->{widget};
247 &$method;
248}
249
250sub destroy {
251 my ($self) = @_;
252 warn "destroy($self)";#d#
253
254 delete $self->{app};
255
256 for (keys %$self) {
257 warn "$self->{$_} destroy" if UNIVERSAL::can ($self->{$_}, "destroy");
258 (delete $self->{$_})->destroy
259 if UNIVERSAL::can ($self->{$_}, "destroy");
260# if (UNIVERSAL::isa ($self->{$_}, Glib::Object)
261# && UNIVERSAL::isa ($self->{$_}, gtk::widget))
262# && $self->{$_}->can("destroy");
263 }
264}
265
266sub DESTROY {
267 my ($self) = @_;
268 warn "DESTROY($self)";#d#
269}
270
2711; 2291;
272 230

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines