Image in background of gadgets - is there a workaround?

Mac OSX specific forum
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Image in background of gadgets - is there a workaround?

Post by jesperbrannmark »

Hi.
I use a background sometimes behind gadgets, it makes it look nicer.
But on mac there is no way of clicking on the gadgets. You can only use TAB to get to the next one.
Try this sample and then try to click on the second stringgadget - nothing happens.
On PC the DisableGadget(0,1) line is needed, otherwise it will not work there either.
If there a workaround on the Mac to glue the image to the background without interfering with the functionality of the gadgets?

Code: Select all

UseJPEGImageDecoder()
OpenWindow(0, 220, 0, 480,220, "Image", #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
LoadImage(0,"spine.jpg")
ImageGadget(0, 0, 0, ImageWidth(0),250, ImageID(0))
DisableGadget(0,1)
StringGadget(1, 250, 85, 180, 18, "")
StringGadget(2, 250, 109, 180, 18, "")
SetActiveGadget(1)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Image in background of gadgets - is there a workaround?

Post by IdeasVacuum »

Well, something that might work is to dispense with the image gadget and just draw the image on the window.........
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

SOLVED Image in background of gadgets - is there a workaroun

Post by jesperbrannmark »

Yep. True. thanks

Code: Select all

UseJPEGImageDecoder()
OpenWindow(0, 220, 0, 480,220, "Image", #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
LoadImage(0,"spine.jpg")
StartDrawing(WindowOutput(0))
DrawImage(ImageID(0),0,0)
StopDrawing()
StringGadget(1, 250, 85, 180, 18, "")
StringGadget(2, 250, 109, 180, 18, "")
SetActiveGadget(1)
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Image in background of gadgets - is there a workaround?

Post by Polo »

IIRC you should watch out for windows repaint event to avoid your image to disappear :)
Post Reply