Standalone bug

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone bug

Post by Klaus » Wed Sep 01, 2010 12:25 pm

Hi Tal,

I got exactly the same result as shown on your image when I run your stack!
1. Clicked the button
2. Clicked on the card
3. Got a tiny graphic

EDIT: Maybe "the templategraphic" is set to some higher values for height/width in your IDE when you try this at home!

Why don't you tell your users to "Click and drag" to create a graphic in any wanted size?
To be able to resize the graphics, you would need more work.

I hate to repeat myself, but:
What means "avorted"? Could not find this word (to avort/avorted?) in the whole internet.


Best

Klaus

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Standalone bug

Post by tal » Wed Sep 01, 2010 1:10 pm

Hi,

I wanted to say aborted instead of avorted, sorry.
So, if you have the same problem, it is a pitty that it works in the .rev and not in the standalone.

Mark, you said you had not a problem with your standlaone?
But me and Klaus cant drag as you do, are you sure you made it in the standalone?

Tal

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone bug

Post by Klaus » Wed Sep 01, 2010 1:28 pm

Hi Tal,

"aborted" ARRRRGH! :D

OK, I built a standalone and can reproduce what you are talking about!
I can drag, but when I release the mouse, this tiny graphic appears as if only clicked once on the card!

Very strange, I have no idea what's going on here. Mark, any clues?


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Standalone bug

Post by bn » Wed Sep 01, 2010 2:50 pm

tal,

Code: Select all

on mouseDown
   set the opaque of the templateGraphic to true
   set the style of the templateGraphic to "oval"
   set the blendlevel of the templateGraphic to 66
   put the clickLoc into tClick
   lock screen
   create graphic
   put the number of graphics of this card into tNumber
   set the numberformat to "000"
   add 0 to tNumber
   set the name of last graphic to "myGraphic " & tNumber
   put "myGraphic " & tNumber into tGraphicName
   set the topleft of grc tGraphicName to tClick
   repeat until the mouse is up
      put the mouseLoc into tLoc
      lock screen
      set the width of grc tGraphicName to max (5, item 1 of tLoc - item 1 of tClick)
      set the height of grc tGraphicName to max (5,item 2 of tLoc - item 2 of tClick)
      set the topLeft of grc tGraphicName to tClick
      unlock screen
      unlock screen
   end repeat
end mouseDown
put this in the card script of your test stack. No need to click the "Click to make graphic" button.
I would not do it this way but it works in development and standalone.
regards
Bernd

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone bug

Post by Klaus » Wed Sep 01, 2010 2:57 pm

Hi Bernd,

cool solution as always :D
But we would really like to know why this (simple) thing does work in the IDE but not in the standalone!


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Standalone bug

Post by bn » Wed Sep 01, 2010 3:37 pm

Klaus,
I think the problem is that in Tal's card script

Code: Select all

on mouseDown
  repeat until the mouse is down
    set the opaque of the templateGraphic to true
    set the style of the templateGraphic to "rectangle"
    set the blendlevel of the templateGraphic to 66
  end repeat
end mouseDown
the mouseDown never finishes and interferes with the normal operation of the graphic creation and changing of its size. Mind you the mouseDown is triggered when clicking on his button and "repeats until the mouse is down" (???)
Why it works in the IDE, I have no idea.
if you put this into the card script of tal's original stack then it works:

Code: Select all

on mouseUp
      set the opaque of the templateGraphic to true
      set the style of the templateGraphic to "rectangle"
      set the blendlevel of the templateGraphic to 66
end mouseUp
regards
Bernd

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone bug

Post by Klaus » Wed Sep 01, 2010 3:46 pm

Hi Bernd,
bn wrote:Klaus,
I think the problem is that in Tal's card script

Code: Select all

on mouseDown
  repeat until the mouse is down
    set the opaque of the templateGraphic to true
    set the style of the templateGraphic to "rectangle"
    set the blendlevel of the templateGraphic to 66
  end repeat
end mouseDown
the mouseDown never finishes and interferes with the normal operation of the graphic creation and changing of its size. Mind you the mouseDown is triggered when clicking on his button and "repeats until the mouse is down" (???)
Why it works in the IDE, I have no idea.
...
Ah, very good catch!
Yep, sounds reasonable, thanks!

Best

Klaus

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Standalone bug

Post by tal » Wed Sep 01, 2010 3:47 pm

Thanks, there is another graphic bug only in the standlaone.
I uploaded it, it is a .rev you did making selected groups, it works fine but if you make a standalone, the graphic selection is invisible.

Tal
Attachments
selectGroupsIIII.rev (1).zip
(5.96 KiB) Downloaded 329 times

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Standalone bug

Post by tal » Wed Sep 01, 2010 3:49 pm

To respond to your previous message, I stopped to use the mousedown message in my card, I only put "choose graphic tool" in a button and no script in my card, so it worked in the .rev and not in the standalone.

Tal

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Standalone bug

Post by Mark » Wed Sep 01, 2010 3:54 pm

Tal,

Have you tried my solution? Could you please answer the questions I asked you?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Standalone bug

Post by bn » Wed Sep 01, 2010 5:06 pm

Tal,
this is not a bug in the standalone. I was trying to be fancy and have set a pattern in the templategraphic. This pattern is not included in the standalone so the graphic is drawn but invisible.
If you edit the card script of "selectGroupsIIII.rev" by commenting out one line it works in the standalone, just without pattern, just black. It is in the on mouseDown handler

Code: Select all

   reset templategraphic
   set the style of the  templategraphic to "rectangle" -- or "oval" or "roundrect"
   set the lineSize of the templategraphic to 3  -- adjust
   -- set the foregroundpattern of the templategraphic to 52 -- 208034 -- block to have straight line w/o pattern
   set the opaque of the templategraphic to false
this is how the relevant codes looks, only the line
-- set the foregroundpattern of the templategraphic to 52 -- 208034 -- block to have straight line w/o pattern
is commented out, the rest is the same as before.
Try this and tell us if it works for you.

by the way: can anyone tell me how to include the patterns in a standalone?

regards
Bernd

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Standalone bug

Post by tal » Wed Sep 01, 2010 5:11 pm

mark, your solution works, I did what you said but i must have done a mistake, so I still had the problem but now I did it again and it works.
Bn, thank you for the precision for the pattern.

Thank you all;

Tal

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Standalone bug

Post by Mark » Wed Sep 01, 2010 5:37 pm

Thanks for your reply, Tal. Great that we could solve this together.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Standalone bug

Post by tal » Thu Sep 02, 2010 11:36 am

Hi,

Just another thing, like bn said, do you know how to use pattern in a standalone?

Tal

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Standalone bug

Post by Mark » Thu Sep 02, 2010 12:32 pm

Hi Tal,

Just lookup "pattern" in the dictionary and give that a try.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply