Modify tcl script to generate code

Modify the tcl script used to generate the code.

  1. Open the main.tcl file in the tpl subdirectory of your template set directory.
  2. Find the # Set XPath set of code. On the line following set rootFileNode, add:
    set icon [[getUniqueNode $ROOTNode {/AG/File/DynamicProperties/DynamicProperty [@name='icon']}] @value]
  3. Find the instruction [gen_MAIN $DBName $outFormRelNodeList $outReportRelNodeList] and add the $icon parameter:
    [gen_MAIN $DBName $outFormRelNodeList $outReportRelNodeList $icon]
  4. Find the instruction proc gen_MAIN {DBName outFormRelNodeList outReportRelNodeList} and add the icon parameter:
    proc gen_MAIN {DBName outFormRelNodeList outReportRelNodeList icon}
  5. Find the instruction genInitializeResources $outFormRelNodeList $outReportRelNodeList 1 and add the icon parameter:
    [genInitializeResources $outFormRelNodeList $outReportRelNodeList $icon 1]
  6. Find the instruction proc genInitializeResources {outFormRelNodeList outReportRelNodeList {indent 0}} and add the icon parameter:
    {outFormRelNodeList outReportRelNodeList icon {indent 0}}
  7. Find the instruction CALL ui.Interface.loadStyles(NVL(l_style, \"dbapp\")) and on the following line add the call to set your image:
    CALL ui.Interface.setImage(\"$icon\")
  8. Save the changes.
  9. Select Tools > Specific setup > Reload.
  10. In the OfficestoreAppFlow.4ba, select the Account program entity and set the value of the Icon property to a valid image name. See Image directory structure.
  11. Save the files.
  12. Rebuild and run the Account program and see the icon used in the window title of the program.
    Figure: Custom icon in window title

    The running application with a smiley face icon in the window title.