ID:141517
 
Code:
winset(src,"button1","is-visible=0")


Problem description:
Because I have some people logging in which are not supposed to beable to do anything but walk around and watch I want to remove three of the buttons in my default interface window.

But for some reason, this won't work?

How would I remove a button which is shown in the interface? I'm aware of the fact you can't DELETE it unless made at runtime, but with remove I ment "make it not visible/useable.

Thanks, in advance!

Use winshow() for this,

winshow(src, "button1", 0) // If its set to 1 it can be seen, 0 it's invisible.
In response to Magicbeast20
Mmm, maybe they could change the help on that one.
Looking it up really gave me the idea it was window specific.
But thanks, I 'll try!
In response to Fint
winshow() is just identical to setting the is-visible parameter, which is present on all controls. And controlshow() would be a crappier name, and stuff.
In response to Kaioken
Is that the ONLY thing winshow() is used for? Setting the is-visible parameter? If it is, that's kind of pointless.
In response to Spunky_Girl
Going by that train of thought, many other things such as list(), for()-list, +=, - and other features could also well be pointless, as they could also be taken as shortcuts for existing functionality. Though of course doing an operation through a more built-it/internal method or level will always be somewhat faster than a higher-level method.
In response to Kaioken
Yeah I figured it'd be slightly faster than the conventional method, but is it really that much of a difference in speed that it needs to be its own function?

And list() is a shorthand way of storing a bunch of variables/references isn't it? So that was kind of necessary.

I think the for() loop is just an easier way of writing a while() loop isn't it? In a for() loop you can actually test/define variables to test right in its arguments, where a while() loop only tests values of pre-defined variables right?
You don't set values to 0 or 1 in an interface; you only use "true" and "false".
In response to Spunky_Girl
Spunky_Girl wrote:
is it really that much of a difference in speed that it needs to be its own function?

It's more of a matter of convenience here, so you get a basic proc for showing or hiding a control. Like you have standard functions for creating a list, incrementing a var, etc.

And list() is a shorthand way of storing a bunch of variables/references isn't it? So that was kind of necessary.

'Necessary'? As you said, it's a shorthand; not so required.

I think the for() loop is just an easier way of writing a while() loop isn't it?

Basically. while() and for() are almost completely interchangeable, yes. There are differences, though: for() can include 1 statement (such as defining 1 var in the scope of the loop) to run before the loop occurs in its parentheses and its condition is optional, and while() has an extra form that allows skipping the condition in the first iteration (do-while).
Then of course there is the for-list loop that's just a shortcut instead of looping through by index.
EDIT: To prevent possible misleading, I'll note that of course there's a useful form of for()-list that can't be reproduced otherwise, but it's one without actually involving a /list.
In response to Jeff8500
Jeff8500 wrote:
You don't set values to 0 or 1 in an interface; you only use "true" and "false".

I've always used 0 and 1, It doesn't make much of a diffrence anyways.
In response to Magicbeast20
You are quite mistaken. While they can be used as true and false values for other, regular stuff (and there are built-in macros for them as TRUE and FALSE), 0 and 1 are incorrect values for on/off control parameters. In fact you can't even specify actual 0 or 1 as the value to set, since the parameter values are always text.
Setting a parameter to "0" will work to turn it off, because it simply treats every value other than "true" as false; setting the parameter to "1" or "poo" would also turn it off.
In response to Kaioken
Ah thanks for the further clarity Kaioken ^-^ I learn as I go apparently.