button negative loc
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
button negative loc
How do I prevent LiveCode from pushing a button into the visible area when setting a negative value? This not happens always... but the following code will do it every time:
clone button "btest"
put the id of it into tid
set the loc of button id tid to -32,100
I can't seem to find a work around...
clone button "btest"
put the id of it into tid
set the loc of button id tid to -32,100
I can't seem to find a work around...
Re: button negative loc
If you debug through it, it will work... so weird stuff going on
also if you replace clone with create button it still happens... cant position it outside of the card
also if you replace clone with create button it still happens... cant position it outside of the card
Re: button negative loc
Hi rinzwind,
I have seen this in the past, not really reproducable, so I gave up and just HIDE all my objects instead.
Best
Klaus
I have seen this in the past, not really reproducable, so I gave up and just HIDE all my objects instead.
Best
Klaus
Re: button negative loc
Well ... it is reproducible.
on mouseUp
create button "abc"
set the loc of button "abc" to -50,-50
end mouseUp
It will position the button in the top left corner instead...
Strangely, set the loc of button "abc" to -50,-50 will work after the whole message path in which button abc is created is done. But that doesn't help much in dynamic scenarios where you want to move a button/'sprite' into the screen from the left. You don't want it to popup out of nowhere. Somehow LiveCode overrides -50,-50 right after creating an object. It will be fine if the button already exists.. but clone/copy/create will make it impossible to position it off screen! argh
on mouseUp
create button "abc"
set the loc of button "abc" to -50,-50
end mouseUp
It will position the button in the top left corner instead...
Strangely, set the loc of button "abc" to -50,-50 will work after the whole message path in which button abc is created is done. But that doesn't help much in dynamic scenarios where you want to move a button/'sprite' into the screen from the left. You don't want it to popup out of nowhere. Somehow LiveCode overrides -50,-50 right after creating an object. It will be fine if the button already exists.. but clone/copy/create will make it impossible to position it off screen! argh
Re: button negative loc
a ridiculous workaround is calling another command using send "setpos buttonid,x,y" to me in 60 milliseconds
that delay is necessary, otherwise it still does not work.
that delay is necessary, otherwise it still does not work.
Re: button negative loc
There is a bug in here somewhere.
If you create a new button by hand, name it "abc", and run the single line
The button goes out of sight to the topLeft. As it should. But if you run the handler as you wrote it, the newly created button does indeed go to the topleft of the window. Not the loc of that button, by the way, but rather the topLeft of the button goes to "0,0".
You want to report this or shall I?
Craig Newman
If you create a new button by hand, name it "abc", and run the single line
Code: Select all
on mouseUp
set the loc of button "abc" to -50,-50
end mouseUp
You want to report this or shall I?
Craig Newman
Re: button negative loc
Bug report is here for anyone who can bump the priority up a bit (seems like an easy to fix thing)
http://quality.runrev.com/show_bug.cgi?id=15918
http://quality.runrev.com/show_bug.cgi?id=15918
Re: button negative loc
What happens if you set the loc of the templateButton before creating the button?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: button negative loc
If you have two buttons, one of which has a handler that creates a field, and the other that sets its loc offscreen, the behavior is as expected.
I can't wait to hear what distinguishes the two fields. that creating one in the same handler that sets its loc makes such a difference.
Craig
I can't wait to hear what distinguishes the two fields. that creating one in the same handler that sets its loc makes such a difference.
Craig