Page 2 of 2

Re: Error msg: "default target" has no main source file .

Posted: Wed Jan 21, 2015 12:16 pm
by Vera
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

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
vmars316 wrote:Why do I need two "OpenWindow_0()" commands .
There aren't two.
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
but thanks for providing your original :)

greets ~ Vera

Re: Error msg: "default target" has no main source file .

Posted: Thu Jan 22, 2015 1:21 am
by vmars316
Thanks Vera :

Code: Select all

Result = SetGadgetState(Image_0, ImageID(0))             
    ; it's enough to set the image

It also sort of explains why (a few compiles ago)
'when the parameters of Image_0 = ImageGadget(#PB_Any, and ImageGadget(Image_0, ' didn't match ,
both image copies
got crammed into 150,50 as 150,25 & 150,25 . :)

btw:
Before I got the "Error msg: "default target" has no main source file ." Working , (I considered it working when I got TWO Buttons working. But of course it wasn't Truly working until you showed me the "SetGadgetState(Image_0, ImageID(0))" command.) ,
I had asked this question:
http://forum.purebasic.com/english/view ... 64#p459730

If you like , Please join in .
Thanks...Vern

Re: Error msg: "default target" has no main source file .

Posted: Thu Jan 22, 2015 1:06 pm
by Vera
vmars316 wrote:both image copies got crammed into 150,50 as 150,25 & 150,25 . :)
Well ... ? ... you might want to remember this for a later fun-feature :wink:


But on a more serious side-note:
From your link I can get your current SID [sessionID] which isn't the best to disclose.

This happens because you are using the old forum-link: http:// forum.purebasic.com/english
By useing the meanwhile and often recommended official address:
http:// www.purebasic.fr/english this will not occur.

cheers ~ Vera

Re: Error msg: "default target" has no main source file .

Posted: Thu Jan 22, 2015 5:18 pm
by vmars316
Oh, Thank You , will do :)