Automatically populating menu from list when user clicks
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Automatically populating menu from list when user clicks
I have been using Menubuilder to create menus, after reading Jeane DeVoto's great tutorial on this page:
http://www.hyperactivesw.com/revscriptc ... ences.html
I am updating the contents of one of the menu items (which are buttons in reality), in real time from a list (actually a remote database). For this I use mouseDown which instantly fills the menu with the remote list, then menuPick to act on each item.
This works when the menubar is on the top of the card as mousedown is recognized. But not when I set the menus to appear in the menubar. What handler can I use instead of mousedown in order to have the same effect?
Bet jacque can help me with this one.
Kaveh
http://www.hyperactivesw.com/revscriptc ... ences.html
I am updating the contents of one of the menu items (which are buttons in reality), in real time from a list (actually a remote database). For this I use mouseDown which instantly fills the menu with the remote list, then menuPick to act on each item.
This works when the menubar is on the top of the card as mousedown is recognized. But not when I set the menus to appear in the menubar. What handler can I use instead of mousedown in order to have the same effect?
Bet jacque can help me with this one.
Kaveh
Kaveh
Re: Automatically populating menu from list when user clicks
I'm confused, the lesson you cite has a section specifically with what your asking about
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Automatically populating menu from list when user clicks
Hi Bogs
Please see attached stack. The menu item on the top left will dynamically fill with the field text, using mousedown.
Now open Tools > Menubuilder, select that menu item, and click:
Set as Stack Menu bar
Now you can see the menu nicely in the menu bar, but of course mousedown does not work any more, so the menu is not updating.
Please see attached stack. The menu item on the top left will dynamically fill with the field text, using mousedown.
Now open Tools > Menubuilder, select that menu item, and click:
Set as Stack Menu bar
Now you can see the menu nicely in the menu bar, but of course mousedown does not work any more, so the menu is not updating.
- Attachments
-
- Menu on the fly.livecode.zip
- (1.07 KiB) Downloaded 193 times
Kaveh
Re: Automatically populating menu from list when user clicks
I dunno, sure looks like it does here -
I deleted all the entries in the menubuilder items
Clicked on the 'on the fly' button again
Everything shows populated from the list
Tells me it is working as you might expect, unless I'm just missing something obvious (I don't work in this version of the IDE a lot, so pretty likely I am just missing something )
I put everything just like you said, then - I deleted all the entries in the menubuilder items
Clicked on the 'on the fly' button again
Everything shows populated from the list
Tells me it is working as you might expect, unless I'm just missing something obvious (I don't work in this version of the IDE a lot, so pretty likely I am just missing something )
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Automatically populating menu from list when user clicks
Thanks for looking again.
I should have said I am using a Mac. I know menus work differently on different systems. Attached is a screen recording to show how the menus work on Mac. Please see how in the menubar, mouseup does not work. I know it is outside LiveCode's control at that point but love to find a solution.
Please see file here:
https://drive.google.com/open?id=1iENAA ... logies.com
Too big to upload to forum...
I should have said I am using a Mac. I know menus work differently on different systems. Attached is a screen recording to show how the menus work on Mac. Please see how in the menubar, mouseup does not work. I know it is outside LiveCode's control at that point but love to find a solution.
Please see file here:
https://drive.google.com/open?id=1iENAA ... logies.com
Too big to upload to forum...
Kaveh
Re: Automatically populating menu from list when user clicks
Hi Kaveh,
the trick is to put the menu changing "mousedown" handler into the script of the GROUP and not of the button(s)! Best
Klaus
the trick is to put the menu changing "mousedown" handler into the script of the GROUP and not of the button(s)! Best
Klaus
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Automatically populating menu from list when user clicks
Thank you Klaus. It works!
I might have got there eventually, but would have taken a lot of trial and error. It sort of makes sense.
I might have got there eventually, but would have taken a lot of trial and error. It sort of makes sense.
Kaveh
Re: Automatically populating menu from list when user clicks
I think this is because only the menubar GROUP on a Mac receives
the "mousedown" message, but not the buttons in it.
the "mousedown" message, but not the buttons in it.
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Automatically populating menu from list when user clicks
Yes, although when the menus are on the card as opposed to the system menubar, the button gets the message too.
Anyway, attached is the modified, working stack, modified as per your suggestion.
Anyway, attached is the modified, working stack, modified as per your suggestion.
- Attachments
-
- Menu on the fly.livecode.zip
- (1.08 KiB) Downloaded 196 times
Kaveh