GF/ST Color Problem in Buttons (resolved)

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

GF/ST Color Problem in Buttons (resolved)

Postby tstalzer » Tue Jun 29, 2010 4:45 am

Hi

I think there is a little bug in the drawing of buttons using GF/St. This can be verified by the forward/back buttons in the Calendar Example.

The buttons get drawn with a black background instead of the current button background.

I believe that using "RGBColor white" in the method GFButtonGO->fromGO: should be changed to "CgRGBColor white". So, the method should be:

Code: Select all
fromGO: go

   "Answer a new instance of the receiver"

   | button bitmap mask |
   button := self new.
   bitmap := GFOpaqueBitmap screenExtent: go displayBox extent.
   mask := GFPixmap screenExtent: go displayBox extent.
   mask pen fill: mask boundingBox color: CgRGBColor white.
   go displayWith: bitmap pen at: 0@0.
   go displayShapeWith: mask pen at: 0@0.
   bitmap setMask: mask.
   button origin: go displayBox origin copy image: bitmap.

   ^button


--Thomas
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Re: GF/ST Color Problem in Buttons

Postby tstalzer » Tue Jun 29, 2010 4:45 am

Oh - I forgot.

This is 8.02
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Re: GF/ST Color Problem in Buttons

Postby wembley » Tue Jun 29, 2010 10:30 am

Thomas -

Actually what is missing is an update to WbKernel class>>#loaded
Code: Select all
loaded
   " WbKernel loaded "
   WbImageManager initializeImageCaches.
   RGBColor initializeOnLoad

and WBKernel class>>#removing
Code: Select all
removing
   " WbKernel removing "
   WbImageManager initializeImageCaches.
   RGBColor
      black: nil;
      white: nil

Don't forget to run RGBColor initializeOnLoad after you make the change. Case 46924 opened and fixed.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: GF/ST Color Problem in Buttons

Postby tstalzer » Wed Jun 30, 2010 8:34 am

Hi John

Short Feedback - it works

Thanks

--Thomas
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest