The Artima Developer Community
Sponsored Link

Agile Buzz Forum
The V4 Pollock widget

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
The V4 Pollock widget Posted: Sep 18, 2005 5:20 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: The V4 Pollock widget
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

Today marked a very special day for both Steve Aldred and myself. Some of our plans for the V4 engine finally came to fruition. Now, I won't say exactly what those plans were or why we're so happy about it, but I will say that we're well on track to delivering an absolutely rocking follow up to our V3 engine.

So on that note, since we're talking Pollock, I thought I might share with you the basic code that is required to make the simplest web browser you could possibly make. This web browser only has a text input with a drop down for URL history and the actual browser pane itself.

It uses only 100% Pollock and V4 code, so there's no wrappers anywhere to be seen. In V4's current state, don't expect miracles, but if you want to see how it is we test out our system then this might be a fun try for you.

On that note, the latest version of WithStyle has many tests failing - these are all V4 tests. This will be addressed as soon we can, but I can assure you that version is safe to run.

The Web browser code:

| window documentPane urlPane |
window := Pollock.UserInterfaceWindow new.
window frame specifiedSize: 800@600.
window addComponent: (urlPane := Pollock.DropDownList new).
window addComponent: (documentPane := Pollock.WithStyleDocument new).
urlPane frame: (Pollock.FractionalFrame fullyAttached bottomOffset: urlPane preferredExtent y; bottomFraction: 0; yourself).
documentPane frame: (Pollock.FractionalFrame fullyAttached topOffset:  urlPane preferredExtent y; yourself). 
urlPane list: Set new asList.
urlPane when: #losingFocus do: [ | url | url := urlPane model value. urlPane list add: url. Cursor wait showWhile: [documentPane documentURI: url]].
window open 
 

This code will open up a window with a combobox at the top and the V4 widget filling up the rest of the window space.

Things of interest:

  • The Pollock.WithStyleDocument is our pane for the Pollock framework to render XML with CSS.
  • Using preferredExtent to position the offsets lets us change font size and have the combobox grow while keeping the rest of the window layout proportional
  • #losingFocus is currently the best choice of event for knowing when to navigate to a URL. I've raised this with Sam and hopefully he'll add some more convincing event API's soon.
  • If you have an instance of a Pollock.WithStyleDocument you can send it messages such as documentPane documentURI: 'http://www.w3.org' asURI or documentPane documentString: '<html><body>Hello World!</body></html>' to give it content to render.

Read: The V4 Pollock widget

Topic: A new problem Previous Topic   Next Topic Topic: The horror

Sponsored Links



Google
  Web Artima.com   

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