Datagrid Options Menu Label

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Datagrid Options Menu Label

Post by newpie » Thu Jan 26, 2017 4:39 am

Hello, I wanted to check with forum on this. Isthe label of an Options Menu button supposed stay when you load the Options menu in a datagrid table. When I try using "set the label of btn.." it doesn't stick. I would like to have the label "Select:" and then my menu items underneath.

The only method I found that worked is below, but then Select is one of menu items.

Code: Select all

on FillInData pData
   -- This message is sent when the Data Grid needs to populate
   -- this template with the column data. pData is the value to be displayed.
   
   -- Example:
   lock messages
   set the text of btn "methodType" of me to "Select:"& cr & "Method A"& cr & "Method B"
   set the menuhistory of button "methodType" of me to lineoffset(pData, the text of button "methodType" of me)
   unlock messages
end FillInData
Thanks for any help

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

Re: Datagrid Options Menu Label

Post by Klaus » Thu Jan 26, 2017 2:52 pm

I really did not know that we could place any other objects than fields into a datagrid of type TABLE!? :shock:

Anyway, it should be enough to:

Code: Select all

on FillInData pData
   set the label of btn "methodType" of me to pData
end FillInData

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: Datagrid Options Menu Label

Post by newpie » Fri Jan 27, 2017 1:31 am

Thank you Klaus, that seem to do the trick when I changed the pData above to "Select:"

Post Reply