View unanswered posts | View active topics It is currently Tue Feb 09, 2010 1:06 pm



Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 How to TCL 
Author Message
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post How to TCL
Setting up TCL4BB

Hello all! I thought I would give a brief tutorial on setting up TCL4BB. I want to make this
easy for folks who stayed away from it because they believed it to be too difficult.

First lets get the goods :D
1. You'll need the actual plugins
You can grab the plugin at this thread:
http://www.lostinthebox.com/viewtopic.php?t=698

2. Grab active tcl. Some would say you don't need it but it's a great tool to have.
You can get that here:
http://www.activestate.com/Products/Dow ... =ActiveTcl

3. Get a copy of twapi. Another very useful tool as I'll show in up coming examples.
http://twapi.sourceforge.net/

Now the setup :D Very easy to do...
1. Install activeTCL.
I installed mine in the root directory of the main drive.. C:\tcl for example

2. Install the twapi. This should be installed in the same directory as your activeTCL
Now there is no installer for twapi. I just openned it in my archiver (winrar) and dragged it to
the lib folder of tcl

3. Place the tcl4bb plugins into your blackbox plugins folder. i.e "blackbox\plugin\tcl4bb"

Now we need to edit the tcl4bb.tcl file. Go to your tcl4bb plugin folder and open this file in your
favorite text editor. After this go to the end of the file and add the following line.
source C:/tcl/lib/twapi/twapi.tcl
The source path may be different depending on where you installed activetcl

However note the '/' for the directory listings... make sure you use those and not the '\' or tcl wont
use the source path.

Ok. You're ready to go. Load the plugin into your box of choice.

At this time nothing happens :D so, we'll need something to test our set up on.

I'm using bbinterface in this example for now.
1. Create a button and name it to Hello1. Don't give it any functions or title text at this time.
2. Open your text editor again and create a new file. Add the following lines:

Code:
proc Hello1 {} {
  tcl-bb::broam "@BBInterface Control SetAgent Hello1 Caption StaticText \"Hello!\""
}

Save this file to Hello1.tcl It's easier to put it in the same folder as your tcl4bb plugin.

Reopen your tcl4bb.tcl file again and add the following at the end of the file..
source C:/blackbox/plugins/tcl4bb/Hello1.tcl
Again.. the drive and path may differ depending on where you installed blackbox and where you put the plugin.

Unload and reload the tcl4bb plugin

Now, for our button.
ctrl+right click the Hello1 bbinterface button you've created and navigate to the MouseDown/Blackbox Bro@m/Entry
and place...

Code:
@tcl-bb eval Hello1


press enter

Now click the button... If everything worked ok, you should now see the label Hello! on the button.

That's all for now as I'm falling asleep.. I'll write more later...

Be sure to check this thread once you get things going..
http://www.lostinthebox.com/viewtopic.php?t=698
[/code]

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Wed Jan 11, 2006 10:22 am
Report this post
Profile WWW
Sponsored Links
Google Adsense


Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post How to TCL - BBI DIGIClock
I thought today I would show you how to do a simple digital clock.

This tutorial uses:

BBInterface
TCL4BB
BroamTimer

Caution for Xoblite users: The broamtimer I have setup here checks the seconds, so you may want
to have it check every minute so it doesn't interfere with you menu too much.

First create a bbinterface label. This can be any element; button, frame, etc.
name the Label to tcl_Clock. You can use what you want for a name, but I chose this
to avoid conflict with other bbi script names.

Second: Open you favorite text editor and put the following lines into it.
Code:
proc thisTime {} {

    set myTime [clock format [clock scan now] -format %I:%M:%S]
    broam "@BBInterface Control SetAgent tcl_Clock Caption StaticText  \"$myTime\""}


For Xoblite users just remove the :%S because you wont need to check for seconds

Now save that code to you TCL4BB folder and name it tlc_clock.tcl
Open the TCL4BB.tcl file and add the following:
Code:
source C:/blackbox/plugins/TCL4BB/tlc_clock.tcl


Now your source location may differ so just make the proper adjustments.

Stop and restart the tcl4bb plugin. At this point a clock should show up on your bbi label. :-D

We need to make the time change with the real time.
So we need to use broamtimer for this.
Open the Broams.rc file in your broamtimer plugin folder and add this:
Code:
@tcl-bb eval thisTime


Open the BroamTimer.rc file now and check the interval setting
I have mine set to 1000
but, xoblite users may want to set this much higher to prevent interaction with their menus.

Now make sure all files have been saved and restart or start your broamtimer plugin.
If you have seconds enabled you should see the seconds counting. :D If not, just wait a minute..lol

If I left out something, I'll add to this later.. If you have any questions just ask

Peace

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Thu Jan 12, 2006 7:10 pm
Report this post
Profile WWW
BBAdult

Joined: Sun Oct 01, 2006 1:25 pm
Posts: 36
Reply with quote
Post hi.
hi,i have a question.i tried to do it as the first example several times..but it didn't work.could you tell me why? thanks


Sun Oct 29, 2006 12:49 pm
Report this post
Profile
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post 
Post a quick file of your tcl examples that your working with. It'll be easier to troubleshoot that. Also, post your tcl-bb.tcl file as well, just to make sure that's done correctly too.

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Tue Oct 31, 2006 7:46 pm
Report this post
Profile WWW
BBAdult

Joined: Sun Oct 01, 2006 1:25 pm
Posts: 36
Reply with quote
Post 
................................
........................
broam @BBShowPlugins
}

proc ToggleAll {} {
toggletray
toggleslit
toggletoolbar
toggleplugins
}
source C:/tcl/lib/twapi/twapi.tcl
source C:/bbLean_116/plugins/tcl4bb/Hello1.tcl

above is in the tcl4bb.tcl file.

proc Hello1 {} {
tcl-bb::broam "@BBInterface Control SetAgent Hello1 Caption StaticText \"Hello!\""
}

this is in the new file(Hello1.tcl) in the folder of tcl4bb plugin

and the bro@m for the button is @tcl eval Hello1

but it just didn't work.i don't know why,and i really want to know why.


Sat Nov 04, 2006 1:47 am
Report this post
Profile
BBAdult

Joined: Sun Oct 01, 2006 1:25 pm
Posts: 36
Reply with quote
Post 
btw,i like your blackbox pro alot.especially the bar on the bottom that looks like Mac.i really would be grateful if you show me how i can have it.ps,i think it's like wharf,just display it horizontally,is that right? but i don't know the trick.hope to hear from you soon. thanks


Sat Nov 04, 2006 1:50 am
Report this post
Profile
BBSage

Joined: Wed Sep 20, 2006 4:13 pm
Posts: 96
Reply with quote
Post 
NB, thanks. been busy with things lately, I havent got past my TCL errors (mentioned in the xmplay thread). When I do get more time ill look right back here. Thanks for the tut.


Sun Nov 05, 2006 10:25 pm
Report this post
Profile
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post 
No problem Supergirl. I'm just hopping more people use tcl-bb so some of use can post more scripts that people can make use of more easily without too many problems.

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Mon Nov 06, 2006 6:09 am
Report this post
Profile WWW
BBTeen
User avatar

Joined: Thu Mar 16, 2006 1:49 am
Posts: 18
Location: Kolombia
Reply with quote
Post 
mmm hey i did as said in the tutorial at the top, the hello1 button, but it says "invalid command name hello1"

is there a list of availabe commands or similar?

i got bblean z mod, tcl full plugin installed and twapi and tcl too.

it has not tcl4bb.rc on tcl plugin folder,cause if it does, says cant find tcl4bb:no such file or directory, even though it comes fit the full tcl plugin


thanx for your help


Mon Nov 27, 2006 7:36 am
Report this post
Profile YIM WWW
Moderator
User avatar

Joined: Wed Jan 26, 2005 8:04 am
Posts: 2252
Location: Philadelphia, PA
Reply with quote
Post 
Try this code instead:

Code:
proc Hello1 {} {
  broam "@BBInterface Control SetAgent Hello1 Caption StaticText \"Hello!\""
}


And for the button, try this:
Code:
@tcl Hello1

_________________
if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page


Mon Nov 27, 2006 10:01 am
Report this post
Profile WWW
BBDinosaur
User avatar

Joined: Tue Nov 22, 2005 6:37 pm
Posts: 213
Location: Somewhere fun with nice ladies
Reply with quote
Post 
is it not "@tcl-bb evalfile Hello1" ?

_________________
It's a trick, get an axe!!!
Image


Mon Feb 05, 2007 1:04 am
Report this post
Profile YIM WWW
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post 
no.
Code:
@tcl-bb evalfile *
loads a file that contains tcl and executed the tcl in taht file.
Code:
@tcl
is short for
@tcl-bb eval
which executes an already created Tcl function or a line of proper Tcl code.
@tcl was created cause I got tired of typing @tcl-bb eval all the time ;)

_________________
-- Brian


Mon Feb 05, 2007 3:32 pm
Report this post
Profile ICQ YIM WWW
Site Admin
User avatar

Joined: Sun Dec 05, 2004 8:59 pm
Posts: 1316
Location: Boise, Idaho
Reply with quote
Post 
A couple side notes.

1) This is how Nightbreed does his setup. I do not condone this method as it sources the twapi.tcl file instead of placing it in the package tree for Tcl-bb and using package require twapi.

2) ActiveTcl is not required for the use of Tcl-bb (I think this can be stressed more). Tcl-bb is staticly linked agianst the Tcl library to avoid issues with different versions of Tcl being installed. Makes for a bigger DLL, but less problems with setup. If something does not work in Tcl-bb but does work in ActiveTcl it is likely because ActiveTcl is at a higher version then the Tcl version I am linked agianst.

Other than those I think this is an excellent first walkthrough for anyone ;-D

_________________
-- Brian


Tue Feb 06, 2007 2:26 am
Report this post
Profile ICQ YIM WWW
Boy meets Box
User avatar

Joined: Fri Dec 29, 2006 2:47 am
Posts: 623
Location: in front of the monitor.
Reply with quote
Post 
I don't use ActiveTcl or ActivePerl, so I'm good...XD

_________________
attack of the mini-man!
bb4win FAQs
mini-man-land


Tue Feb 06, 2007 3:56 pm
Report this post
Profile YIM WWW
BBDinosaur
User avatar

Joined: Tue Nov 22, 2005 6:37 pm
Posts: 213
Location: Somewhere fun with nice ladies
Reply with quote
Post 
newb tut
Uber TCL Tut

_________________
It's a trick, get an axe!!!
Image


Sun Feb 11, 2007 10:24 am
Report this post
Profile YIM WWW
Sponsored Links
Google Adsense


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.