emulate checkbox w/ label Thread last updated on 2004-05-19 23:16:09

Posted by member 17337 on 2004-04-22 03:34:47

Not sure where to post this so I hope the modules forum is the appropriate place.

I am hoping to create a control panel of sorts for settings in a theme. Rather than toggle modules on and off via a popup, I want to open a window (lsbox?) and display some checkboxes (label?) that will essentially toggle a var in a file.

I know how to set/replace var files using mzscript and textedit but am wondering if it is possible to emulate a checkbox that reads from vars.

Hope that makes some sense.

Posted by member 12798 on 2004-04-22 12:30:15 link

so what is your problem? of course it's possible - because hey, this is litestep :)
you seem to know everything you need, just look at some themes and let your mind do the rest :)

Posted by member 1 on 2004-04-22 12:51:27 link

of course it is possible as ElkMonster said, but is it really worth it? you must remember about memory consumption and the like. i actually did this with my copy of Thin and it jumped from about 10M of usage to almost 30 because I had over 45 labels defined. I was able to overcome a lot of it...but still...painfull.

Posted by member 17337 on 2004-04-22 15:21:30 link

Thanks for the input. I guess my question really wasn't "is it possible" using scripting and labels but is there a more efficient way of doing it. I half suspected that it may not be worth the resource overhead and the scripting required.

I think I will favor performance and efficiency over a neat feature that really isn't that neat anyway.

Thanks again!

Posted by member 12798 on 2004-04-22 16:22:27 link

you could use only a few labels and just change the texts and "functions" ... don't know if this will make it practical to handle, though.

Posted by member 125450 on 2004-04-22 21:10:06 link

I was thinking of something along that line, I wanted to use html in a box to do the same thing. turns out there is no module to support that.

Posted by member 1 on 2004-04-22 22:57:16 link

Only problem is that you can't change the text and have everything look right still...so yer talking 2 labels per entry...so 10 settings is 20 labels. What a pain. :)

Posted by member 7223 on 2004-04-23 00:32:31 link

I'll use one label (for the text) and one skinbox (for the chekbox) and just call a script that create all the stuff for a given list of varriables. Shouldn't be difficult to do.
Of course all the stuff is destroy when the "window" is closed.

Posted by member 1 on 2004-04-23 01:14:31 link

one skinbox per choice or one skinbox for all choices? because I don't see how you could get one skinbox for the choices so you might as well do it with double labels.

Posted by member 37809 on 2004-04-23 06:07:47 link

Double labels? I haven't tested the latest xlabel but apparently what's new is that !LabelRefresh is "the most powerful bang ever." It has "on-the-flyness" dynamics akin to SkinBox, so you only need one label per choice -- you can try xlabels to both contain text and using scripting to "toggle" the background image between graphics representing checked and unchecked. Then of course hook these labels all to either a skinbox or you may as well do it in a big label (whose text can serve as the title if you're mimicking a window), and then in theory they can be created and destroyed through bangs (one !labelcreate for the container label, i'm not sure about destroying...). and xLabel's convenient grouping mechanism could also ease the creation of a tabbed dialog I suppose.

Posted by member 125450 on 2004-04-23 06:49:14 link

Sounds pretty cool might have to try that

Posted by member 12025 on 2004-04-23 07:28:55 link

Have it create the box(es) when you access it, and destroy when done. That should curb normal memory use.
I tried this before, and it ended up being much easier to use popups.
Something that would be awesome: to define a combo or drop-down box and its values based on a var (say, "blue:green:red:black:purple"), setting the vars as you select.
(I've had a lot of pipe dreams lately :))

Posted by member 125450 on 2004-04-23 10:15:46 link

can you shot me an example?

Posted by member 102612 on 2004-04-23 11:30:17 link

I just posted a request about ckDialog for the same functionality. Any ideas how the above would compare to an ckDialog implementation? It's a pain to change multiple setting via the popup. Seems like popping up a dialog of sorts and changing multiple settings at once is the way to go. ... if it's not too complex and heavy on resources.

Posted by member 1 on 2004-04-23 12:04:40 link

Use popup for your dropdown and change your xLabel config as TNL suggested. Should work.

Posted by member 12798 on 2004-05-19 18:51:16 link

the_space_guild: if you're still interested - the upcoming final version of xlabel-3.0 will have the new feature to use href in labeltexts, so you can execute bangs by clicking the text. you could create something that works like checkboxes this way.

Posted by member 102612 on 2004-05-19 23:16:09 link

that brings up a good point. You can exec bangs by clicking on text anyway (even using label 1.99). So popup a background image w/ labels on it. Then click on the labels to exec multiple theme changes at once, then click on the "close" text which hides the whole affair.