Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8847717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:15:24+00:00 2026-06-14T12:15:24+00:00

Having problems implementing radio buttons. I know radio buttons in CS2 can be problematic

  • 0

Having problems implementing radio buttons. I know radio buttons in CS2 can be problematic but I’m not sure where I am going wrong. I suspect I have a bracket or comma in the wrong place; but can’t see it. Thank you.

var dlg =
"dialog {text:'Script Interface',bounds:[100,100,300,260]," +
"info: Group { orientation: 'column', alignChildren: 'center'," + 
"radiobutton0:RadioButton {bounds:[50,30,150,40] , text:'layerName0', alignment: 'left' }," +
"radiobutton1:RadioButton {bounds:[50,50,150,90] , text:'layerName1', alignment: 'left'  }}" +
"cancelBTN:Button{bounds:[110,130,190,150] , text:'Cancel' },"+
"processBTN:Button{bounds:[10,130,90,150] , text:'Ok' }}";
var win = new Window(dlg,"radio buttons"); 
win.radiobutton0.value = true;
win.center(); 
win.show();

Another thing: Is there a better way of writing UI elements as this format is rather ugly.

Here’s the bare bones code that works.
var dialogBox =
“dialog { orientation: ‘column’, alignChildren: ‘center’, \
info: Group { orientation: ‘column’, alignChildren: ‘center’, \
rbtn1: RadioButton { text: ‘Radio Button 1’, align: ‘left’}, \
rbtn2: RadioButton { text: ‘Radio Button 2’, align: ‘left’}, }, }, \
} }”;

win = new Window (dialogBox);
win.center(); 
win.show();

I think the radio button toggle is controlled by line 3 as commenting it out stops the radio buttons working correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:15:25+00:00Added an answer on June 14, 2026 at 12:15 pm

    When I ran the code it threw an error on this line win.radiobutton0.value = true; Object is undefined. This is because the way you have the dialog structured the button is part of the info group within the window. The line should read

    win.info.radiobutton0.value = true;
    

    This should toggle radiobutton0 on initially.

    You don’t have to use a resource string to craft the dialogs if you don’t want. Individual elements can be added by creating a reference to the window object (or to a pallate or panel) and using .add()

    For example:

    var w = new Window ("dialog");
    w.alignChildren = "left";
    var radio1 = w.add ("radiobutton", undefined, "Radio Button 1");
    var radio2 = w.add ("radiobutton", undefined, "Radio Button 2");
    radio1.value = true;
    w.show ();
    

    This is the most thorough reference on ScriptUI that I’ve found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've bought the virtual gallery from flashden but I'm having problems implementing it.. I'm
I'm having problems implementing classes in mootools since I can't use 'this' when I
I'm having some problems implementing an algorithm to read a foreign process' memory. Here
Am having a number of problems implementing the code from the Washington Post site
I'm having problems implementing a kind of comments form, where comments (called microposts) belong_to
I am having problems implementing my PHP/MySQL code into a jgrowl. If you are
I'm having problems implementing an asynchronous image loader to the following code. I read
I am having problems implementing the following jQuery effect to my navigation. There will
I'm having some problems with the stack in java... I'm implementing quicksort using an
I'm having some problems implementing an exception system in my program. I found somewhere

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.