Window Regions dont seem to work on buttons
Posted: Fri Jul 29, 2005 3:03 pm
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