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

Just starting out? Need help? Post your questions and find answers here.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

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

Post 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
vmars316
Enthusiast
Enthusiast
Posts: 474
Joined: Fri Jun 29, 2012 12:24 am
Contact:

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

Post 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
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

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

Post 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
vmars316
Enthusiast
Enthusiast
Posts: 474
Joined: Fri Jun 29, 2012 12:24 am
Contact:

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

Post by vmars316 »

Oh, Thank You , will do :)
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
Post Reply