The Artima Developer Community
Sponsored Link

Agile Buzz Forum
How To Create A Custom Widget - Introduction

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
How To Create A Custom Widget - Introduction Posted: Jul 28, 2004 2:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: How To Create A Custom Widget - Introduction
Feed Title: Pollock
Feed URL: http://www.cincomsmalltalk.com/rssBlog/pollock-rss.xml
Feed Description: Pollock - the next VW GUI
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Pollock

Advertisement

Today we start a new series of How To posts. This time, we tackle the task of creating a Pollock widget. An oft asked for widget is a Calendar. So, over the next weeks and months, we'll create such a widget. Now, this widget will not be a part of Production Pollock... well, at least not initially.

Why is that? Well, there is some difference between how I write code for Production and how I write code for this How To. When I'm writing for Production, I own the whole Pollock code base. For this How To, I'm going to take on the role of a developer using Pollock. In effect, I'll only have control over the How To code... just like you would if you were writing it. Refactorings of the base to ease my way are not on the table, instead, extensions, if I have to make them, are. As we go along, I'll point out along the way the various places where changes to Pollock could help to make things easier, and address them. Of course, I'll be taking notes for myself, and if a potential efficiency is found, be sure I'll make sure it finds its way into the core.

The first step is a design.... sort of.

I use a tool called xReminder. It is a small utility for Windows that allows me to enter appointments and notices, and then pops up a reminder before the scheduled event. This isn't a plug for that utility. The tool however has a fairly nice example of a Calendar widget:

This is pretty good. Let's use this as our design. Some things might be different, depending on how we actually do the work when we come to it.

Pollock doesn't currently support a XP look, that won't come until Production 2. However, in our How To exercises here, we'll do a Windows, Motif and a MacOSX look. As with the modified XP process I use for developing Pollock, we'll start with just one target: Windows. We'll then address the Motif and MacOSX looks in turn.

Along the way here, we'll create SUnit tests. Some I'll just describe here, others I'll talk about and publish them.

We'll also go through and add support for the XML and LiteralArray building of our widget using the building mechanism in Pollock. This will involve adding support to the Pollock XML Sax readers and writers, as well as the building infrastructure.

All in all, we'll peek and poke at a lot of the guts of Pollock. In doing so, hopefully you'll learn not only how Pollock works, and it's designs, but also how to use it even if you are not going to create your own widgets.

The parameters:

  • We'll be using the 7.2.1 version of VisualWorks that has just been released.
  • We'll be using the version of Pollock that is in the Preview directory of 7.2.1. You can also download it from the Cincom Public Repository : Version 5.32

So, let's start.

Today, all we're going to do is create the Package which we will work in. We'll name it Pollock-Calendar. We'll even be nice and give the package a comment:

This package will contain the work and tests for a new Pollock widget: The Calendar Pane. This work is in conjunction with the How To Build A Custom Widget on the Pollock Blog. http://www.cincomsmalltalk.com/userblogs/pollock/blogView

The above is published as version 1.0 in the Package named "Pollock-Calendar" on the Cincom public repository.

And... that's it for today. Next time, we'll decide on where in the Pollock Pane hierarchy we'll add our Calendar... In doing so, we'll present a decision tree that you can use for your own Pollock custom widget work.

Buckle up, the ride is about to begin.


And So It Goes
Sames

Read: How To Create A Custom Widget - Introduction

Topic: Orwellian compatibility Previous Topic   Next Topic Topic: Pinup of the day

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use