. .

st4u

ST 4U 223: Allocation Profiling in VisualWorks

April 23, 2012 9:58:14.831

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:

allocations

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:

Technorati Tags: , ,

Enclosures:
[st4u223-iPhone.m4v ( Size: 3142153 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 222: A Look Around the Composition Editor

April 20, 2012 8:08:05.524

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:

VA Assist Pro.

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":

Widgets

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:

VA Assist

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:

Common 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.

Technorati Tags: , ,

Enclosures:
[st4u222-iPhone.m4v ( Size: 2440185 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 221: Limiting Your Connections Viewed

April 18, 2012 8:14:46.643

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:

Connection Filtering.

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:

Connections

By default, you'll be seeing all connections. Try selecting "Hide all Connections":

Hide 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:

Event Connections

Or just the attribute connections:

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.

Technorati Tags: , ,

Enclosures:
[st4u221-iPhone.m4v ( Size: 2062913 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 220: Time Profiling in VisualWorks

April 16, 2012 9:19:52.570

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:

Profiling

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:

Technorati Tags: , ,

Enclosures:
[st4u220-iPhone.m4v ( Size: 4143980 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 219: Creating a Visual Part in VA Smalltalk

April 13, 2012 10:51:48.185

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:

Parts.

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:

Connections

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:

Beep

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:

Connection

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:

length

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:

repeat

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:

Start

Stop

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.

App

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.

Save

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.

Technorati Tags: , ,

Enclosures:
[st4u219-iPhone.m4v ( Size: 5613950 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 218: Creating a Non-Visual Part in VA Smalltalk

April 11, 2012 12:22:44.398

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:

Parts.

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:

Organizer

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:

Part

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.

Script Editor

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:

Events

Next, change the tab to actions, and set up stop and start as actions (they will start and stop the timer):

Actions

Now that we've done all of that, pull down the "File" menu, and select "Generate Default Scripts". You should see the following:

Generate

Generation Options

Hit Ok, and then we can open a browser up and see what we have:

Browser

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):

Script Editor

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:

Script Editor


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.

Save

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.

Technorati Tags: , ,

Enclosures:
[st4u218-iPhone.m4v ( Size: 8828722 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 217: Searchlight

April 9, 2012 9:28:28.730

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:

Searching

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:

Technorati Tags: , , ,

Enclosures:
[st4u217-iPhone.m4v ( Size: 2924008 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 216: Screenshots Within VA Smalltalk

April 6, 2012 11:02:31.221

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:

screencap.

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:

<

screencap

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):

screen cap

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.

Technorati Tags: , ,

Enclosures:
[st4u216-iPhone.m4v ( Size: 3964465 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 215: Toothpick in VA Smalltalk

April 4, 2012 10:01:16.500

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:

Tootpick.

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:

SUnit

Once you have SUnit it, load the Toothpick config map:

Toothpick

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.

That sets up the logger. Now we'll use it:


LoggingEvent 
	category: #debug 
	level: #warn 
	message: 'using obsolete protocol'.


A quick look at the Transcript shows that it works as we intended:

Toothpick

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.

Technorati Tags: , ,

Enclosures:
[st4u215-iPhone.m4v ( Size: 3680673 )]

posted by James Robertson

 Share Tweet This

st4u

ST 4U 214: Logging with Toothpick

April 2, 2012 10:28:31.039

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:

Logging

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

Technorati Tags: , ,

Enclosures:
[st4u214-iPhone.m4v ( Size: 6126431 )]

posted by James Robertson

 Share Tweet This

Previous Next (554 total)