[Bioperl-l] [Gmod-gbrowse] accessing params for custom glyphs?

Lincoln Stein lincoln.stein at gmail.com
Fri Apr 18 15:16:19 EDT 2008


Hi Russell,

It's very simple:

   my $params = $self->option('new_parameter');

Lincoln

On Thu, Apr 17, 2008 at 9:39 PM, Smithies, Russell <
Russell.Smithies at agresearch.co.nz> wrote:

> This is probably more of a Perl OO problem I'm having, but can anyone
> tell me how to access a parameter when I create a custom glyph?
>
> I've created a panel in the usual way then I add a feature with
> 'my_glyph' and want to pass the value of -new_parameter to the glyph
> drawing code.
>
>    $panel->add_track( $feature,
>                        -font => gdSmallFont,
>                        -glyph => 'my_glyph' ,
>                        -height => 10,
>                                -label  => 1,
>                                -strand => "forward",
>                                -new_parameter => "test",
>
>
> In my_glyph.pm, I have the usual draw_component sub:
>
> sub draw_component {
>  my $self = shift;
>  my $gd = shift;
>  my ($x1,$y1,$x2,$y2) = $self->bounds(@_);
>  my $fg = $self->fgcolor;
>  my $params = $self->??????????   <<--- how do I access the value of
> "new_parameter" set in the panel drawing code?
>
>  $gd->line($x1,$y1,$x2,$y2,$fg);
>  $gd->line($x1,$y2,$x2,$y1,$fg);
>
> }
>
> Any ideas?
>
> Thanx,
>
> Russell Smithies
> =======================================================================
> Attention: The information contained in this message and/or attachments
> from AgResearch Limited is intended only for the persons or entities
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipients is prohibited by AgResearch
> Limited. If you have received this message in error, please notify the
> sender immediately.
> =======================================================================
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Gmod-gbrowse mailing list
> Gmod-gbrowse at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>



-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)
FOR URGENT MESSAGES & SCHEDULING,
PLEASE CONTACT MY ASSISTANT,
SANDRA MICHELSEN, AT michelse at cshl.edu


More information about the Bioperl-l mailing list