my $values;
my ($widget, $context, @other_params) = @_;
my $colormap = $window->get_default_colormap;
my $pixbuff = Gtk2::Gdk::Pixbuf->new_from_file(“figure.png”);
my $graphicContext = Gtk2::GC->get(Gtk2::Gdk::Visual->get_best_depth,
$colormap,
$values);
$pixbuff->render_to_drawable($widget->get_parent_window,
$graphicContext,
0,0,0,0,500,500,‘normal’,0,0);
}
what is “my ($widget, $context, @other_params) = @_”???
I don’t understand all above- -"
can you convert set_bg fuction to ruby language for me please :’(
convert parameters to vars
usage is set_bg($widget,$context,@other_params) in perl
my ($widget, $context, @other_params) = @_;
with ‘my’ you initialize a variable (in object window are using a method
get_default_colormap
my $colormap = $window->get_default_colormap;
my $pixbuff = Gtk2::Gdk::Pixbuf->new_from_file(“figure.png”);
my $graphicContext = Gtk2::GC->get(Gtk2::Gdk::Visual->get_best_depth,
$colormap,
$values);
$pixbuff->render_to_drawable($widget->get_parent_window,
$graphicContext,
0,0,0,0,500,500,‘normal’,0,0);
}
what is “my ($widget, $context, @other_params) = @_”???
I don’t understand all above- -"
can you convert set_bg fuction to ruby language for me please :’(
Greets from Argentina!
By ToCaDo157
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.