Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Friday, February 19, 2016

Red console view GUI

This is a simpler example to paste into a Red console to test the GUI basics of using the view dialect.

view [
    below
    tgl: text "Some test text"
    text 400x30 bold italic blue font-size 16 "Text with properties"
    button "Click Me" [tgl/text: "Text Changed!"]
    field 400 "SELECT this text then Type something into this entry field"
    area 400x200
]

A Red script might declare that it needs the view module in its header.

The above script was tested with the Feb 19 2016 build of Red.





Monday, December 13, 2010

Curl BaseFrame

The Curl class BaseFrame is declared as
public BaseFrame {inherits BasicBox}
and is not abstract. Frame inherits from it as
public Frame {inherits BaseFrame}
and is certainly not abstract. But a RootFrame to root a graphic hierarchy is declared as
public abstract sealed RootFrame {inherits Frame}
and is abstract -yet its immediate subclass View is declared as
public View {inherits GuiRangeSelectionContext, RootFrame}
and is a very common class for concrete instances.  GuiSelectionRange is also abstract and is declared as
public abstract GuiRangeSelectionContext {inherits TextSelectionContext, BaseGuiRangeSelectionContext, ContainerDragScroller, OptionListInterface}
RootFrame and GuiRangeSelectionContext are performing a special role that Traits or Mixins might perform in another language.

View has a need to have its visibility specified as a property, which can be a stumbling block in first experiments with Curl. Here is an example:

{curl 7.0 applet}
{import WindowVisibility from CURL.GRAPHICS.WINDOW}
{View visibility=WindowVisibility.normal,
   {text Some text that will appear in a freestanding window}
}

View has an interesting subclass which is rather like the first window one used to create for MS Windows back in the days of C using only a frame: OutlineOnlyView.

BaseFrame is a usable class, which is not what the name would suggest in some other languages: it is usable in the sense that a subclass can make immediate use of its constructor in a class declaration as shown in the Curl docs:
{constructor {default}
     {construct-super.BaseFrame
which the docs say can be used as a special frame destined to have only one child graphic or visual object.

Thursday, August 19, 2010

Camera Obscura and "Back to DSL"

With our re-location we are back to DSL as we are just past the area with Op Fiber to-the-door (this must be one of the few cities with free public wi-fi downtown and to cross the five feet with fiber.

Unlike the typical American publiv library in a small city, the public library here has a shelf of philosophy books both in Dewey 100+ and 180+ including one volume that was a very pleasant surprise.

The biggest treat: a hand controlled "camera obscura" in a dome by the river.  This is not augmented vision with adjusted focus as in a magnifiying glass, a spyglass, a telescope, a film camera or a video camera: this unique manner viewing a display ( I do not say "image") of reflections of the trees on the surface of a flowing river, passing gulls or tourists on the bridge - an artist's permanent installation - alone would be worth the journey.