Re: Error msg: "default target" has no main source file .
Posted: Wed Jan 21, 2015 12:16 pm
Hi Vern ~ that works good except for one issue.
Within Button_0_clicked you create a new image although that image already exists through the OpenWindow_0 procedure. It's only needed to set the picture for that existing imagegadget
One is the command and the other is the according procedure that's been called. ... Maybe I missed your question?
Yes we can't share files on the forum, so we often use the images from the PB-distribution if it's just for testing. And they can be addressed like this:
but thanks for providing your original
greets ~ Vera
Within Button_0_clicked you create a new image although that image already exists through the OpenWindow_0 procedure. It's only needed to set the picture for that existing imagegadget
Code: Select all
If LoadImage(0, "RainbowBar.png")
; ImageGadget(Image_0, 20, 75, 150, 50, ImageID(0)) ; creating a new image with an already existing image-constant triggers an IMA
Result = SetGadgetState(Image_0, ImageID(0)) ; it's enough to set the image
; Result = ImageGadget(#Gadget, x, y, Width, Height, ImageID [, #PB_Image_Raised)
EndIf
There aren't two.vmars316 wrote:Why do I need two "OpenWindow_0()" commands .
One is the command and the other is the according procedure that's been called. ... Maybe I missed your question?
Yes we can't share files on the forum, so we often use the images from the PB-distribution if it's just for testing. And they can be addressed like this:
Code: Select all
Debug #PB_Compiler_Home
Debug #PB_Compiler_Home + "logo.png"
Debug #PB_Compiler_Home + "examples/sources/Data/world.png" ; on Linux
Debug #PB_Compiler_Home + "Examples\Sources\Data\world.png" ; on Win

greets ~ Vera