Today's Smalltalk 4 You looks at the allocation profiler in VisualWorks (the same tool is available for ObjectStudio). If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
Today's Smalltalk 4 You takes a look at some of the ways that VA Assist Pro helps out with the Composition Editor. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll look at where the widgets that you use in the Parts tool are picked and placed, and how VA Assist Pro makes that task a bit easier. To start with, examine the left hand side of the screen. The toolbars on the left have widgets: the leftmost is categories. Select one, and you get widgets in that "Set":
Quite often, you'll want some of the more commonly used parts - and that's where VA Assist Pro comes in. Open that up from the "Options" menu:
If you switch to the "Parts" tab, you'll see some of the more commonly used widgets. This often makes it easier to build UIs, as they will mostly be made up of stock parts:
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You digs into the Composition Editor in VA Smalltalk again. It's easy to add enough connections to make things a bit confusing - fortunately, you can filter them in various ways. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll look at filtering the connections view in the composition editor. While our simple example has a small number of connections, it will serve to demonstrate how you can filter out what you do and don't want to see. First, pull down the "Connections" menu:
By default, you'll be seeing all connections. Try selecting "Hide all Connections":
Now we are looking at a canvas with just our parts on it. At this point, we can return to the same menu and start turning connections selectively on - for instance, just the events:
Or just the attribute connections:
By doing this, we can examine our connections in detail and not get lost in the full complexity. You can also tell what's going on at a glance - note that event connectors are green, while attribute connectors are blue.
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You looks at the Time profiler in VisualWorks. The same tool works in ObjectStudio, even though that's not being shown here. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
Today's Smalltalk 4 You adds a UI that connects to the timer (non visual) part we created last time. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll create a visual part in VA Smalltalk, and hook it up to the non-visual part we created last time. Here's the end result - we'll walk through the steps, taking the connections one by one, from the top of the screen down:
First, how did we add the non-visual part? We used the "add part" menu option in the composition editor, and selected the part by browsing for the name. It appears as a "puzzle piece", since there's no UI. To connect up the #timerFired event to a script, right click on the part, and select "connect". When presented with options, select the script - you'll add a #beep method:
The code for that is as follows:
beep
CgDisplay default bell: 20
That will simply play a tone when the timer fires - that way we can tell whether our hookups worked. The properties for this look like this:
To get the UI parts on the canvas, simply select them in the toolbar at the top of the window, click on the canvas below, and move them around. To set properties, double click - you'll need to set the input field to be an integer, for instance.
Next, create a connection from the input field to the timer object. Hook up the "Object" (value) attribute of the field to the length attribute of the timer. Now when we enter a value, it will flow to the timer object:
Now create a connection from the checkbox to the repeat attribute (which we set up as a boolean) in the timer. If checked, this will run our timer repeatedly:
Next, we need to hook up the start and stop buttons. Create one connection for each to the timer - hook up "clicked" to the start and stop actions respectively:
Now use the Test menu option. The UI should come up. Enter 1000 (this is milliseconds) in the input field, and then hit the start button. You should get a tone if you have it all set up properly.
That just about wraps it up - version this off in ENVY so you can continue with it later - you've just hooked up your visual and non-visual parts in VA Smalltalk.
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You looks at creating a new part (non-visual) using the VA Smalltalk parts editing tools. In the next screencast, we'll use the part created here in a UI. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll create a non-visual part in VA Smalltalk. IN our next tutorial, we'll integrate this part into a visual one. To get started, open the organizer - which opens automatically in a new VA image:
Enter an application name, let the rest default, and hit ok. When the Composition editor opens, you can close that - we won't need it yet. Instead, from the defining window, create a new part. Give it a name, and set it to be non-visual:
In the View menu, switch to the public interface editor. We need to add some attributes (instance variables), actions, and events. For the latter ones we'll be using the script editor to add Smalltalk code.
Add length and repeat. For repeat, set the object type to Boolean. Then change the tab (top of the tool) to events - we need to add an event, timerFired:
Next, change the tab to actions, and set up stop and start as actions (they will start and stop the timer):
Now that we've done all of that, pull down the "File" menu, and select "Generate Default Scripts". You should see the following:
Hit Ok, and then we can open a browser up and see what we have:
While you're in the browser, add an instance variable - "timer". That will be the actual timer object. Once we have that, we need to go back to the editor, and change back to the script view. We'll now add some methods for #start, #stop, and #timerFired (the latter being the event that happens when our timer goes off):
The code you'll add is below. For each method, select "New Method Template" from the method menu, and then add the code. You can also just add these in the stock browser; either way, they end up in the same place:
start
"Perform the start action."
timer := CwAppContext default
addTimeout: self length
receiver: self
selector: #eventTimerFired:
clientData: nil.
stop
"Perform the stop action."
timer notNil ifTrue: [CwAppContext default
removeTimeout: timer ].
eventTimerFired: anObject
"Notify other parts that the timer has expired."
self signalEvent: #timerFired.
timer := nil.
self repeat ifTrue: [self start].
That just about wraps it up - version this off in ENVY so we can continue with it later - you've just created a reusable, non-visual part in VA Smalltalk.
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You looks at the Searchlight tools in VisualWorks (also available in ObjectStudio). If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
Today's Smalltalk 4 You looks at taking screencaps within the VA Smalltalk environment. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll look at a simple feature of VA Smalltalk that is easily overlooked: the ability to take screen captures (full or partial) from within VA. That includes the ability to focus on individual windows and widgets. To get started, go to the Options menu in the launcher:
<
Select the Screen option. If you select a region or window, you'll get a (configurable) delay during which you can bring the desired window to the front. If you decided to capture the entire screen, you should see something like this (using paste into Paint):
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You looks at Toothpick for logging in VA Smalltalk. It's a lot like log4s, which we covered in other screencasts. The difference? Tootpick works across all the major Smalltalk dialects. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll take another look at logging in VA Smalltalk, but we'll use Tootpick - the cross platform logging solution for Smalltalk systems. First, download the ENVY package from Metaprog.
Once you have that, import the .dat file into your repository (see this screencast for an example of doing that). Then load SUnit support - it's an unlisted pre-req for the configuration map:
Once you have SUnit it, load the Toothpick config map:
Now we can proceed to use the same code that works in other Smalltalks. First, set up the logger (we'll use a Transcript logger here), and start the logging system:
"create a logger"
logger1 := TranscriptLogger new
name: 'My first Logger'.
"where do logging events go"
logger1 format: SimpleLoggingFormatter defaultFormat.
"logging policy"
logger1 policy: (LoggingPolicy category: #debug level: #debug).
"register the logger"
(LoggingMultiplexer current)
addLogger: logger1.
"Start the loggers"
(LoggingMultiplexer current) startAllLoggers.
A quick look at the Transcript shows that it works as we intended:
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Today's Smalltalk 4 You looks at logging with Toothpick in VisualWorks and Pharo (the code is available for VA, and Dolphin as well - and the VW code works in ObjectStudio, while the Squeak code is what I used in Pharo). If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
The logging code used in the screencast, which you can find documented at metaprog:
"create a logger"
logger1 := TranscriptLogger new
name: 'My first Logger'.
"where do logging events go"
logger1 format: SimpleLoggingFormatter defaultFormat.
"logging policy"
logger1 policy: (LoggingPolicy category: #debug level: #debug).
"register the logger"
(LoggingMultiplexer current)
addLogger: logger1.
"Start the loggers"
(LoggingMultiplexer current) startAllLoggers.
LoggingEvent
category: #debug
level: #warn
message: 'using obsolete protocol'.
LoggingMultiplexer current stopAllLoggers