Re: menuHistory & menuPick

2017-08-06 Thread hh via use-livecode
The following recipe is for use in LC 7/8/9. In LC 6 setting the label
sets also the menuhistory.

Delete your "set menuhistory line" and add the following to the script
of your button 1:

on mouseDown
  set the menuhistory of me to lineoffset(the label of me, me)
end mouseDown

> jbv wrote:
> I have a hidden option button with several choices :
>   choice1
>   choice2
>   choice2
> 
> At some point the content of the btn gets updated and it becomes
> visible with the following script :
>   put "choice4" & return & "choice5" & return & "choice6" into btn 1
>   set label of btn 1 to line 2 of btn 1
>   set menuhistory of btn 1 to 2
> 
> The purpose of the "menuhistory" line is, when user press the btn,
> to have all the choices "centered around" the visible one on the
> label, which is more elegant imho...


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-05 Thread jbv via use-livecode
On Sat, August 5, 2017 2:52 pm, Klaus major-k via use-livecode wrote:
>

>> Am 05.08.2017 um 14:15 schrieb jbv via use-livecode
>> :
>>
>>
>> well, not exactly...
>
> But it answered exactly your initial question, Sir!
>
>
>> here's the thing : I have a hidden option button with several choices :
>>  choice1 choice2 choice2
>>
>> At some point the content of the btn gets updated and it becomes
>> visible with the following script : put "choice4" & return & "choice5" &
>> return & "choice6" into btn 1 set label of btn 1 to line 2 of btn 1 set
>> menuhistory of btn 1 to 2
>>
>> The purpose of the "menuhistory" line is, when user press the btn,
>> to have all the choices "centered around" the visible one on the label,
>> which is more elegant imho...
>
> Well, this is a completely different situation and I am a bit clueless.
> Now do you want to execute the menupick handler or not?
>

Nope, I want to bypass the menupick message.
Your suggestion to block messages would block all messages, not just
menupick.
As mentioned in my original post, I managed to do it with a boolean variable.
I was just wondering about the availability of a more elegant solution, using
LC built-in features for instance...
Best regards



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-05 Thread Klaus major-k via use-livecode

> Am 05.08.2017 um 14:15 schrieb jbv via use-livecode 
> :
> 
> well, not exactly...

But it answered exactly your initial question, Sir!

> here's the thing : I have a hidden option button with several choices :
>  choice1
>  choice2
>  choice2
> 
> At some point the content of the btn gets updated and it becomes visible
> with the following script :
>  put "choice4" & return & "choice5" & return & "choice6" into btn 1
>  set label of btn 1 to line 2 of btn 1
>  set menuhistory of btn 1 to 2
> 
> The purpose of the "menuhistory" line is, when user press the btn,
> to have all the choices "centered around" the visible one on the label,
> which is more elegant imho...

Well, this is a completely different situation and I am a bit clueless.
Now do you want to execute the menupick handler or not?


Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-05 Thread jbv via use-livecode
well, not exactly...
here's the thing : I have a hidden option button with several choices :
  choice1
  choice2
  choice2

At some point the content of the btn gets updated and it becomes visible
with the following script :
  put "choice4" & return & "choice5" & return & "choice6" into btn 1
  set label of btn 1 to line 2 of btn 1
  set menuhistory of btn 1 to 2

The purpose of the "menuhistory" line is, when user press the btn,
to have all the choices "centered around" the visible one on the label,
which is more elegant imho...

jbv


On Sat, August 5, 2017 1:10 pm, Klaus major-k via use-livecode wrote:
>

>> Am 04.08.2017 um 23:27 schrieb Bob Sneidar via use-livecode
>> :
>>
>>
>> Hi JB.
>>
>>
>> To set the menu display value without triggering menuPick, set the
>> label of the menu button. In order to trigger the menuPick handler when
>> changing the value, use menuHistory. No need to suspend messages or
>> anything fancy like that.
>>
>> Bob S
>>
>
> and the winner is: Mr. Bob S.! :-)
>
>>> On Aug 4, 2017, at 11:04 , jbv via use-livecode
>>>  wrote:
>>>
>>>
>>> Hi
>>> According to the doc, when you set the menuHistory property, a
>>> menuPick message is sent to the button. I managed to block the menupick
>>> message with a boolean variable, but is there an easier/more elegant
>>> way to momentary block that message when setting menuhistory ?
>>>
>>> Thanks in advance.
>>> jbv
>
> Best
>
>
> Klaus
>
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list use-livecode@lists.runrev.com Please visit this
> url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-05 Thread Klaus major-k via use-livecode

> Am 04.08.2017 um 23:27 schrieb Bob Sneidar via use-livecode 
> :
> 
> Hi JB. 
> 
> To set the menu display value without triggering menuPick, set the label of 
> the menu button. In order to trigger the menuPick handler when changing the 
> value, use menuHistory. No need to suspend messages or anything fancy like 
> that. 
> 
> Bob S

and the winner is: Mr. Bob S.! :-)

>> On Aug 4, 2017, at 11:04 , jbv via use-livecode 
>>  wrote:
>> 
>> Hi
>> According to the doc, when you set the menuHistory property, a menuPick
>> message is sent to the button.
>> I managed to block the menupick message with a boolean variable, but is
>> there an easier/more elegant way to momentary block that message when
>> setting menuhistory ?
>> 
>> Thanks in advance.
>> jbv

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-04 Thread Craig Newman via use-livecode
Hi.


No LC to play with at the moment, but since setting the menuHistory is setting 
a property, might fiddling with setProp possibly be a way to subvert the 
sending of the message?


Craig Newman



-Original Message-
From: jbv via use-livecode <use-livecode@lists.runrev.com>
To: How to use LiveCode <use-livecode@lists.runrev.com>
Cc: jbv <j...@souslelogo.com>
Sent: Fri, Aug 4, 2017 2:04 pm
Subject: menuHistory & menuPick

Hi
According to the doc, when you set the menuHistory property, a menuPick
message is sent to the button.
I managed to block the menupick message with a boolean variable, but is
there an easier/more elegant way to momentary block that message when
setting menuhistory ?

Thanks in advance.
jbv


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-04 Thread Bob Sneidar via use-livecode
Hi JB. 

To set the menu display value without triggering menuPick, set the label of the 
menu button. In order to trigger the menuPick handler when changing the value, 
use menuHistory. No need to suspend messages or anything fancy like that. 

Bob S


> On Aug 4, 2017, at 11:04 , jbv via use-livecode 
>  wrote:
> 
> Hi
> According to the doc, when you set the menuHistory property, a menuPick
> message is sent to the button.
> I managed to block the menupick message with a boolean variable, but is
> there an easier/more elegant way to momentary block that message when
> setting menuhistory ?
> 
> Thanks in advance.
> jbv
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-04 Thread Klaus major-k via use-livecode

> Am 04.08.2017 um 20:35 schrieb jbv via use-livecode 
> :
> 
> Hi Klaus
> Thanks for the reply.
> Actually that option crossed my mind, but what if other useful messages
> need to be sent in the meantime, or if there are any pending messages ?

Then the world, as we know it, will END! :-D

> What gets blocked actually ?

Sorry, really cannot tell. Why not try it?

> Thanks
> jbv
> 
> On Fri, August 4, 2017 8:07 pm, Klaus major-k via use-livecode wrote:
>> Hi jbv,
>> 
>> 
>>> Am 04.08.2017 um 20:04 schrieb jbv via use-livecode
>>> :
>>> 
>>> 
>>> Hi
>>> According to the doc, when you set the menuHistory property, a menuPick
>>> message is sent to the button. I managed to block the menupick message
>>> with a boolean variable, but is there an easier/more elegant way to
>>> momentary block that message when setting menuhistory ?
>> 
>> ...
>> lock messages set the menuhistory of btn "a wonderful menu button" to 42
>> unlock messages ...
>> will do the job. :-)

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-04 Thread jbv via use-livecode
Hi Klaus
Thanks for the reply.
Actually that option crossed my mind, but what if other useful messages
need to be sent in the meantime, or if there are any pending messages ?
What gets blocked actually ?

Thanks
jbv

On Fri, August 4, 2017 8:07 pm, Klaus major-k via use-livecode wrote:
> Hi jbv,
>
>
>> Am 04.08.2017 um 20:04 schrieb jbv via use-livecode
>> :
>>
>>
>> Hi
>> According to the doc, when you set the menuHistory property, a menuPick
>> message is sent to the button. I managed to block the menupick message
>> with a boolean variable, but is there an easier/more elegant way to
>> momentary block that message when setting menuhistory ?
>
> ...
> lock messages set the menuhistory of btn "a wonderful menu button" to 42
> unlock messages ...
> will do the job. :-)
>
>> Thanks in advance.
>> jbv
>
> Best
>
>
> Klaus
>
>
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
>
>
> ___
> use-livecode mailing list use-livecode@lists.runrev.com Please visit this
> url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: menuHistory & menuPick

2017-08-04 Thread Klaus major-k via use-livecode
Hi jbv,

> Am 04.08.2017 um 20:04 schrieb jbv via use-livecode 
> :
> 
> Hi
> According to the doc, when you set the menuHistory property, a menuPick
> message is sent to the button.
> I managed to block the menupick message with a boolean variable, but is
> there an easier/more elegant way to momentary block that message when
> setting menuhistory ?

...
lock messages
set the menuhistory of btn "a wonderful menu button" to 42
unlock messages
...
will do the job. :-)

> Thanks in advance.
> jbv

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


menuHistory & menuPick

2017-08-04 Thread jbv via use-livecode
Hi
According to the doc, when you set the menuHistory property, a menuPick
message is sent to the button.
I managed to block the menupick message with a boolean variable, but is
there an easier/more elegant way to momentary block that message when
setting menuhistory ?

Thanks in advance.
jbv


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode