Delete Menu Item from Option Menu Button

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Delete Menu Item from Option Menu Button

ELS Prothero via use-livecode
Can someone tell me how to delete a menuItem from an Option Menu button programmatically?

Standing by ready to apply dope slap.

Roger
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Delete Menu Item from Option Menu Button

ELS Prothero via use-livecode
On 11/14/20 4:03 PM, Roger Guay via use-livecode wrote:
> Can someone tell me how to delete a menuItem from an Option Menu button programmatically?
>
> Standing by ready to apply dope slap.

No dope slap necessary - it's not really obvious.
The menuItems are stored as the text of the button, so you can get and
set it easily.

put button <whichButton> into tText
-- edit tText here
-- you can do a lineOffset and delete line x of tText
put tText into button <whichButton>

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Delete Menu Item from Option Menu Button

ELS Prothero via use-livecode
Thanks, Mark. That’s the approach I was trying but had forgotten about lineOffset. Instead, i was trying the Find command etc and making no headway.

Roger

> On Nov 14, 2020, at 4:31 PM, Mark Wieder via use-livecode <[hidden email]> wrote:
>
> On 11/14/20 4:03 PM, Roger Guay via use-livecode wrote:
>> Can someone tell me how to delete a menuItem from an Option Menu button programmatically?
>> Standing by ready to apply dope slap.
>
> No dope slap necessary - it's not really obvious.
> The menuItems are stored as the text of the button, so you can get and set it easily.
>
> put button <whichButton> into tText
> -- edit tText here
> -- you can do a lineOffset and delete line x of tText
> put tText into button <whichButton>
>
> --
> Mark Wieder
> [hidden email]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Delete Menu Item from Option Menu Button

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
I always use “the text of” to make it more readable.

Bob S


On Nov 14, 2020, at 4:31 PM, Mark Wieder via use-livecode <[hidden email]<mailto:[hidden email]>> wrote:

On 11/14/20 4:03 PM, Roger Guay via use-livecode wrote:
Can someone tell me how to delete a menuItem from an Option Menu button programmatically?
Standing by ready to apply dope slap.

No dope slap necessary - it's not really obvious.
The menuItems are stored as the text of the button, so you can get and set it easily.

put button <whichButton> into tText
-- edit tText here
-- you can do a lineOffset and delete line x of tText
put tText into button <whichButton>

--
Mark Wieder
[hidden email]<mailto:[hidden email]>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode