Minor Redraw Bug

From: Michael Peuser h <mpeuser_at_t-online.de>
Date: Thu, 13 Feb 2003 19:09:21 +0100
To: <prima_at_prima.eu.org>

When pressing a - lets say - radio button hilite colors will be used for display. After release this does not change, probably because the atribute 'focus' is not updated correctly. After the window is repainted colors are o.k. again; however it does not help to try to repaint from onClick...

So if you use colors or backColors you have to force a repaint somehow...

Another work around: Set hiliteColor and hiliteBackColor as well to the same values as color and backColor.

Probably coloring is rarely used - I noticed the bug because I wanted to draw my customized radio buttons using color attribute.
I substituted ::Radio's onPaint routine by

onPaint=>sub {
   my ($self,$canvas) = @_;
   my @clr;
   if ( $self-> enabled)
   {
        @clr = ($self-> color, $self-> backColor);
   } else {
        @clr = ($self-> disabledColor, $self-> disabledBackColor); }

   my @size = $canvas-> size;
   unless ( $self-> transparent)
   {
      $canvas-> color( $clr[ 1]);
      $canvas-> bar( 0, 0, @size);
   }
      my $xStart=16;
      my $y = ( $size[1] - $xStart) / 2;

         $canvas-> color( $clr[0]);
         $canvas-> fill_ellipse(10,$y+10,20,20);
           $canvas-> color( cl::Black);

         $canvas-> ellipse(10,$y+10,20,20);
    
      if ( $self-> checked)
      {
         $canvas-> color( cl::Black);
  $canvas-> fill_ellipse(10,$y+10,10,10);
     }

BTW: I neve rmanaged to get some "disabled" display???
Kindly Mike

My System (Active State) Perl 5.61, Prima 1.08, Windows 2000
Received on Thu 13 Feb 2003 - 19:08:53 CET

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:04 CET