How to show a button in a hidden group

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mpcard
Posts: 1
Joined: Thu Jan 15, 2009 9:25 pm

How to show a button in a hidden group

Post by mpcard » Thu Jan 15, 2009 9:30 pm

Hello everyone-

I have an application I am building where I have a large group of buttons. When I switch tabs on my application, I want to hide this group of buttons but later depending on user action make 2 of the buttons visible. My script seems to be working OK but the command to show the buttons that are part of the hidden group does not work, the buttons remain invisible:

on menuPick pItemName
switch pItemName
case "Filter Criteria"
show group "SummaryGroup1"
hide group "AllFilterGroups" // big group of buttons
hide button "RunButton"
show button "FieldMenu1" // button in big group that was just hidden
show button "OpMenu1" // button in big group that was just hidden
show button "RunButton"
break
case "Results"
set the visible of group "SummaryGroup1" to false
set the visible of group "AllFilterGroups" to false
hide button "RunButton"
break
end switch
end menuPick

Any ideas on what I should do? Is it possible to "show" a member of a "hidden" group?

-Mike

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Jan 15, 2009 10:42 pm

Hi mpcard,

Just hide all buttons (or all controls, even) of your group and show the buttons you need.

Code: Select all

show grp "Your Group"
repeat with x = 1 to number of buttons of grp "Your Group"
  hide btn x of grp "Your Group"
end repeat
-- blabla here
show btn "The button you want to show"
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply