Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile to a single executable. 1

Status
Not open for further replies.

joe90

Technical User
Dec 18, 2000
10
US
Hi,
I have a Tcl/Tk application with some buttons that use .xbm bitmmaps. If I compile my TCL script using freewrap - I still need to include the .xbm files when I distribute the code. Is there a way I can compile the bitmaps as well as the script?


Thanks for any help (even if it's just to RTFM)

Joe
 
Freewrap should have no problem at all with this. Just include those files in the list of files to wrap. For example:

[tt]freewrap myprog.tcl images/*.xbm[/tt]

As it says in Section 5 of the Freewrap documentation:

"When running a wrapped application, the first file specified on the command line at the time of wrapping will be executed as a TCL/TK script. All other files specified on the command line or in a file load list are available to this executing script.

You can do the following with the wrapped files.[ol][li]Source them[/li][li]Open them[/li][li]Read them[/li][li]Close them[/li][li]Use the file open and file close commands[/li][li]Use them with the image create command[/li][li]Specify them for -bitmap widget options."[/li][/ol]Be sure to read the documentation page on "Naming and referring to wrapped files," especially if you're wrapping files on Windows. You can read that page online at - Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Thanks for the reply but I still couldn't get it to work.:-(

My code includes:

-bitmap @c:\\sw_dev\\upar.xbm -justify center

my freewrap command line uses -f to attach a list of files,
the file (plus.txt) looks like:
c:\sw_dev\upar.xbm
c:\sw_dev\dnar.xbm

However, when I remove the two bitmap files from the SW_DEV folder (to see if the .exe will run standalone) I get ...

Error sourcing /SW_Dev/rtvd_tx.tcl: error reading bitmap file "c:\sw_dev\upar.xbm"

So, am I doing something really stupid ?
 
From the Freewrap "Naming and referring to wrapped files" document,
"Windows users will notice that freeWrap strips all drive letter information from a file's path prior to storing it inside the wrapped application. When referenced inside the wrapped program, the path to the wrapped files must have no drive letter."

I'd also use the Tcl-native pathname (forward slashes for directory separators) instead of the Windows-native pathname (backslashes for directory separators), as it's simpler to use inside of a Tcl script, and that's what the Freewrap documentation shows:

[tt]-bitmap @/sw_dev/upar.xbm[/tt]

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top