Window Regions dont seem to work on buttons

Everything else that doesn't fall into one of the other PB categories.
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Window Regions dont seem to work on buttons

Post by localmotion34 »

i am trying to make a round button by simply creating an eliptic region, and setting the region to the button handle. supposedly, this prevents drawing outside of the region area for that window, but the button remains fully visible.

Code: Select all

wind=OpenWindow(0, 0, 0, 800, 600, #PB_Window_ScreenCentered|#PB_Window_SystemMenu, "Eliptic Region") 
If CreateGadgetList(WindowID()) 
  text=TextGadget(#PB_Any,50,50,80,17,"hi",#PB_Text_Center|#ss_notify)
  ;img=ImageGadget(#PB_Any,60,70,17,17,UseImage(ledpics(0)),#SS_WHITEFRAME		)
  but=ButtonGadget(#PB_Any,60,70,100,30,"Test")
  ;SetParent_(GadgetID(img),GadgetID(text))
  region=CreateEllipticRgn_(0,0,100,20)
  SetWindowRgn_(GadgetID(but),region,#True)
  ;ShowWindow_(GadgetID(img),#SW_SHOW)
  RedrawWindow_(GadgetID(text),0,0,#RDW_ALLCHILDREN)
;DeleteObject_(region)
EndIf 



  ;-Event Loop 
Repeat 
  event = WaitWindowEvent() 
  
  Select  event 
    
    Case #WM_LBUTTONDOWN  
      
      
      
    Case #PB_Event_CloseWindow 
      Quit = 1    
    Case  #PB_Event_Menu 
      Select EventMenuID() 
        
      EndSelect 
    Case #PB_Event_Gadget 
      event1=EventGadgetID() 
      Select event1 
        
      EndSelect 
  EndSelect 
  
Until Quit = 1  

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw