It is currently Tue May 21, 2013 1:33 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Image in background of gadgets - is there a workaround?
PostPosted: Sat Dec 03, 2011 6:59 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 16, 2009 10:42 am
Posts: 531
Location: sweden
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:
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


Top
 Profile  
 
 Post subject: Re: Image in background of gadgets - is there a workaround?
PostPosted: Sat Dec 03, 2011 8:33 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
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.


Top
 Profile  
 
 Post subject: SOLVED Image in background of gadgets - is there a workaroun
PostPosted: Sat Dec 03, 2011 8:38 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 16, 2009 10:42 am
Posts: 531
Location: sweden
Yep. True. thanks
Code:
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


Top
 Profile  
 
 Post subject: Re: Image in background of gadgets - is there a workaround?
PostPosted: Sun Dec 04, 2011 7:26 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
IIRC you should watch out for windows repaint event to avoid your image to disappear :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye