12 Replies Latest reply on Aug 13, 2018 5:43 AM by Trevorׅ

    Can’t seem to be able to change statictext font size

    Frederick Yocum

      Help me out here. I cannot seem to be able to apply a larger font size to a multiline statictext object.


      Here is the javascript function, which seems to work properly, except for interacting with the font properties. I want to use the default font, but want it a little larger, and for bonus points — bold. I will settle for just larger.



      function message_dialog(message) {
        //The dialog which displays a message and can also terminate the script
        var the_dialog = new Window('dialog', 'SuperDuper Find Change'); //Make the window
        the_dialog.alignChildren = 'fill'; // Make sure the child object have 100% width
        the_dialog.orientation = 'row';
        the_dialog.alignChildren = 'top';
        the_message_group = the_dialog.add('group');
        the_message_group.orientation = 'column';
        the_message_group.alignChildren = 'left';
        the_message_group.preferredSize.width = 300;
        the_message_group.margins = 4; //Set the area around the children.
        //Create a container for the message.
        st_message = the_message_group.add('statictext', undefined, message, {multiline:true});
        st_message.characters = 35; // WARNING: do not hit st.preferredSize before you set the characters property! 
      /** --- @TODO  The font change below appears to have no affect ---**/
        st_message.graphics.font =  'dialog:21';
        //Add the Okay button
        the_button_group = the_dialog.add('group');
        the_button_group.alignment = 'right';
        the_button_group.alignment = 'top';
        the_button_group.add("button", undefined, "OK");
      } //End message_dialog function