Command Line Operations |
19 |
![]() |
For further information on starting WorkShop Visual in Microsoft Windows mode see the Starting in Microsoft Windows Mode section on page 10-334 of the Cross Platform Development chapter.
Using a private colormap is useful if you intend to use a lot of colors in the pixmap editor. See the Editing Pixmaps section on page 160 for a description of the pixmap editor. If you do select this option, however, you may observe strange color effects in other windows.
19.3 Generating Code from the Command Line
The command line synopsis is:visu [-csepAKCSEulbarmRMFWX [code_file]] [-windows] -f filename
code_file represents the file to be generated. If you do not specify a code_file, WorkShop Visual generates code to the last target file specified in your source file for the given language.
The M, F, W and R switches must be used in conjunction with the -windows switch.
19.3.1 Examples
The command:visu -c foo.c -f foo.xd
generates C code from the design in foo.xd into the file foo.c. visu -c -f foo.xd
generates C code from foo.xd into the target file that was specified the last time C code was generated from foo.xd via the Generate Dialog.visu -c -e -s -f foo.xd
orvisu -c <c_file> -e <extern_file> -s <stub_file> -f foo.xd
WorkShop Visual exits with status zero if successful and non-zero status if it fails to generate the code for any reason. 19.3.2 Trouble-Shooting
WorkShop Visual must be connected to an X server to generate code from the command line. Usually command line code generation does not create any visible windows but windows do appear momentarily on the server screen for designs containing certain types of widgets, such as ScrolledList and ScrolledText and when generating Microsoft Windows code.
19.4 WorkShop Visual Replay
WorkShop Visual Replay (when used to record user actions) is supplied as a stand-alone application called visu_record. When used to play back recorded scripts it is supplied as a stand-alone application called visu_replay.visu_record -f MyRecordScript AnApplication
MyRecordScript is the name of a file into which a script recording the session will be saved. AnApplication is the name of the application you wish to record.visu_replay -f MyRecordScript AnApplication
MyRecordScript is the name of a file containing the script of the recorded session. AnApplication is the name of the application you wish to rerun.
19.5 WorkShop Visual Capture
WorkShop Visual Capture is supplied as a stand-alone application called visu_capture.visu_capture -f MyCaptureDesign.xd AnApplication
MyCaptureDesign.xd is the name of the file which will contain the captured application. This file will use WorkShop Visual's save file format. AnApplication is the name of the application you wish to capture.
19.6 Converting UIL Source to WorkShop Visual Save Files
The uil2xd filter converts UIL source code to WorkShop Visual save files. It reads UIL source from standard input and writes a save file for WorkShop Visual on standard output.uil2xd [-tlxywhpsaX] [-I include_dir]
The command line options are listed in the following table:
uil2xd does not handle the following constructs:
It generates a save file for the latest version of WorkShop Visual. The command line synopsis is:
gil2xd [-xywhpsaX]The command line options are listed in the following table:
gil2xd does not handle connections other than function calls and the simple notify actions for buttons which can be mapped to links. Other connections are reported as warnings. gil2xd simply ignores these constructs.
19.7.1 Mappings
Few of the mappings from OPEN LOOK objects to Motif widgets are straightforward as they depend somewhat on their context. The fundamentals of the mappings are outlined below. base-window
Maps to a DialogShell with a MainWindow child with a Form work area. popup-window
Maps to a DialogShell with a Form child. canvas-pane
Maps to a DrawingArea which will be a child of a ScrolledWindow if horizontal-scrollbar or vertical-scrollbar is true. An associated PopupMenu
is created as a child of the DrawingArea. control-area
Maps to a Form. menu
Maps to a Menu. If the menu has a menu-title attribute, the first child widget will be a Label which shows the title, followed by a Separator. The menu items are mapped to additional children of the Menu. If the menu-type attribute is command, the widgets will be ToggleButtons; if they have an associated menu they will be CascadeButtons, otherwise they will be PushButtons. As WorkShop Visual has no concept of shared menus, menus which are referenced from more than one place will map to copies of the Menu. message
Maps to a Label. button
Maps to a PushButton if it does not have a menu, otherwise it maps to a CascadeButton. This CascadeButton will be created in a MenuBar. CascadeButtons which have the same y co-ordinate will be created in the same MenuBar. The MenuBar will be created in an enclosing MainWindow if possible, otherwise it will be created at the appropriate location. slider and gauge
Both map to a Scale. Separators will be added as children for tick marks and Labels may be added to show the min-value-string and max-value-string. The min-value and max-value map to the Scale's minimum and maximum fields respectively. setting
Maps to an OptionMenu if setting-type is stack, otherwise maps to a RowColumn. The choices are mapped to PushButtons in an OptionMenu and ToggleButtons in a RowColumn. For exclusive and non-exclusive settings the ToggleButton is adjusted so that the indicator is not used (shadowThickness = 2, marginLeft = 0, indicatorOn = false). text field
Maps to RowColumn with Label and Text widgets. Text will be ScrolledText if text-type is set to multiline. list
Maps to a ScrolledList. If the list has a label attribute set, the ScrolledList is created as a child of a RowColumn with a Label child which displays the label. If the list has a title attribute, the ScrolledList is created as a child of a Frame with a Label to display this title. drop-target
Maps to a Label. stack
Maps to a Form which has each of the stack members as children. The children are attached to both sides of the Form. group
Maps to a RowColumn which has each of the member widgets as children. term-pane and text-pane
Both map to ScrolledText. 19.7.2 Attributes
Once the gil objects have been mapped to widgets the attributes must be mapped to appropriate widget resources. The following resources are always mapped:
The width and height resources are only used if the -w or -h flags are set when gil2xd is run. The x and y resources will be output if the -x or -y flags are set. However, for widgets which are children of Forms the x and y co-ordinates will be used to calculate default Form attachments to preserve the approximate layout.
Actions which have a CallFunction function_type are mapped to callbacks where appropriate.
There are a number of other gil actions which are not detailed in this list. These are not supported by the filter as there is no appropriate Motif callback.