GNU Smalltalk Library Reference


Up: (DIR)

GNU Smalltalk Library Reference

This document describes the class libraries that are distributed together with the gnu Smalltalk programming language.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.


Next: , Previous: Top, Up: Top

1 Graphical users interfaces with BLOX

Alphabetic list:

Classes documented in this manual are boldfaced.

     
Object
  BLOX.BEventTarget
    BLOX.BCanvasObject
      BLOX.BBoundingBox
        BLOX.BEmbeddedImage
        BLOX.BEmbeddedText
        BLOX.BLine
        BLOX.BRectangle
          BLOX.BOval
            BLOX.BArc
      BLOX.BPolyline
        BLOX.BSpline
    BLOX.BEventSet
      BLOX.BBalloon
    BLOX.Blox
      BLOX.BMenuObject
        BLOX.BMenu
          BLOX.BPopupMenu
        BLOX.BMenuBar
        BLOX.BMenuItem
          BLOX.BCheckMenuItem
      BLOX.BWidget
        BLOX.BExtended
          BLOX.BButtonLike
            BLOX.BColorButton
          BLOX.BDropDown
            BLOX.BDropDownEdit
            BLOX.BDropDownList
          BLOX.BProgress
        BLOX.BPrimitive
          BLOX.BButton
            BLOX.BRadioButton
            BLOX.BToggle
          BLOX.BEdit
          BLOX.BForm
            BLOX.BContainer
              BLOX.BRadioGroup
            BLOX.BDialog
            BLOX.BWindow
              BLOX.BPopupWindow
              BLOX.BTransientWindow
          BLOX.BImage
          BLOX.BLabel
          BLOX.BViewport
            BLOX.BCanvas
              BLOX.BScrolledCanvas
            BLOX.BList
            BLOX.BText
    BLOX.BTextBindings
  BLOX.BTextAttributes
  BLOX.BTextTags
  BLOX.Gui


Next: , Up: BLOX package

1.1 BLOX.BArc

Defined in namespace BLOX
Superclass: BLOX.BOval
Category: Graphics-Windows
I can draw arcs, pie slices (don't eat them!!), chords, and... nothing more.


Up: BLOX.BArc

1.1.1 BLOX.BArc: accessing

endAngle
Answer the ending of the angular range that is occupied by the arc, expressed in degrees


endAngle: angle
Set the ending of the angular range that is occupied by the arc, expressed in degrees


fillChord
Specify that the arc will be filled by painting an area delimited by the arc and the chord that joins the arc's endpoints.


fillSlice
Specify that the arc will be filled by painting an area delimited by the arc and the two radii joins the center of the arc with each of the endpoints (that is, that a pie slice will be drawn).


from
Answer the starting point of the arc in cartesian coordinates


from: aPoint
Set the starting point of the arc in cartesian coordinates


from: start to: end
Set the two starting points of the arc in cartesian coordinates


startAngle
Answer the beginning of the angular range that is occupied by the arc, expressed in degrees


startAngle: angle
Set the beginning of the angular range that is occupied by the arc, expressed in degrees


sweepAngle
Answer the size of the angular range that is occupied by the arc, expressed in degrees


sweepAngle: angle
Set the size of the angular range that is occupied by the arc, expressed in degrees


to
Answer the ending point of the arc in cartesian coordinates


to: aPoint
Set the ending point of the arc in cartesian coordinates


Next: , Previous: BLOX.BArc, Up: BLOX package

1.2 BLOX.BBalloon

Defined in namespace BLOX
Superclass: BLOX.BEventSet
Category: Graphics-Examples
This event set allows a widget to show explanatory information when the mouse lingers over it for a while.


Next: , Up: BLOX.BBalloon

1.2.1 BLOX.BBalloon class: accessing

balloonDelayTime
Answer the time after which the balloon is shown (default is half a second).


balloonDelayTime: milliseconds
Set the time after which the balloon is shown.


shown
Answer whether a balloon is displayed


Next: , Previous: BLOX.BBalloon class-accessing, Up: BLOX.BBalloon

1.2.2 BLOX.BBalloon: accessing

shown
Answer whether the receiver's balloon is displayed


text
Answer the text displayed in the balloon


text: aString
Set the text displayed in the balloon to aString


Previous: BLOX.BBalloon-accessing, Up: BLOX.BBalloon

1.2.3 BLOX.BBalloon: initializing

initialize: aBWidget
Initialize the event sets for the receiver


Next: , Previous: BLOX.BBalloon, Up: BLOX package

1.3 BLOX.BBoundingBox

Defined in namespace BLOX
Superclass: BLOX.BCanvasObject
Category: Graphics-Windows
I am the ultimate ancestor of all items that you can put in a BCanvas and which are well defined by their bounding box - i.e. everything except BPolylines and BSplines.


Up: BLOX.BBoundingBox

1.3.1 BLOX.BBoundingBox: accessing

boundingBox
Answer a Rectangle enclosing all of the receiver


center
Answer the center point of the receiver


center: center extent: extent
Move the object so that it is centered around the center Point and its size is given by the extent Point. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


corner
Answer the Point specifying the lower-right corner of the receiver


corner: pointOrArray
Set the Point specifying the lower-right corner of the receiver; pointOrArray can be a Point or a two-item Array. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


extent
Answer a Point specifying the size of the receiver


extent: pointOrArray
Set the Point specifying the size of the receiver; pointOrArray can be a Point or a two-item Array. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


moveBy: pointOrArray
Move the object by the amount indicated by pointOrArray: that is, its whole bounding box is shifted by that amount. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


origin
Answer the Point specifying the top-left corner of the receiver


origin: pointOrArray
Set the Point specifying the top-left corner of the receiver; pointOrArray can be a Point or a two-item Array. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


origin: originPointOrArray corner: cornerPointOrArray
Set the bounding box of the object, based on a Point specifying the top-left corner of the receiver and another specifying the bottom-right corner; the two parameters can both be Points or two-item Arrays. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


origin: originPointOrArray extent: extentPointOrArray
Set the bounding box of the object, based on a Point specifying the top-left corner of the receiver and another specifying its size; the two parameters can both be Points or two-item Arrays. No changes take place until you invoke the #create (if the object has not been inserted in the canvas yet) or the #redraw method.


Next: , Previous: BLOX.BBoundingBox, Up: BLOX package

1.4 BLOX.BButton

Defined in namespace BLOX
Superclass: BLOX.BPrimitive
Category: Graphics-Windows
I am a button that a user can click. In fact I am at the head of a small hierarchy of objects which exhibit button-like look and behavior


Next: , Up: BLOX.BButton

1.4.1 BLOX.BButton class: instance creation

new: parent label: label
Answer a new BButton widget laid inside the given parent widget, showing by default the `label' String.


Previous: BLOX.BButton class-instance creation, Up: BLOX.BButton

1.4.2 BLOX.BButton: accessing

backgroundColor
Answer the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


backgroundColor: value
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


callback
Answer a DirectedMessage that is sent when the receiver is clicked, or nil if none has been set up.


callback: aReceiver message: aSymbol
Set up so that aReceiver is sent the aSymbol message (the name of a zero- or one-argument selector) when the receiver is clicked. If the method accepts an argument, the receiver is passed.


font
Answer the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


font: value
Set the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


foregroundColor
Answer the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


foregroundColor: value
Set the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


invokeCallback
Generate a synthetic callback


label
Answer the value of the label option for the widget.

Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be determined by other options, such as anchor. For windows, this is the title of the window.


label: value
Set the value of the label option for the widget.

Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be determined by other options, such as anchor. For windows, this is the title of the window.


Next: , Previous: BLOX.BButton, Up: BLOX package

1.5 BLOX.BButtonLike

Defined in namespace BLOX
Superclass: BLOX.BExtended
Category: Graphics-Examples
I am an object whose 3-D appearance resembles that of buttons.


Up: BLOX.BButtonLike

1.5.1 BLOX.BButtonLike: accessing

callback
Answer a DirectedMessage that is sent when the receiver is clicked, or nil if none has been set up.


callback: aReceiver message: aSymbol
Set up so that aReceiver is sent the aSymbol message (the name of a zero- or one-argument selector) when the receiver is clicked. If the method accepts an argument, the receiver is passed.


invokeCallback
Generate a synthetic callback


pressed
This is the default callback for the widget; it does nothing if you don't override it. Of course if a subclass overriddes this you (user of the class) might desire to call this method from your own callback.


Next: , Previous: BLOX.BButtonLike, Up: BLOX package

1.6 BLOX.BCanvas

Defined in namespace BLOX
Superclass: BLOX.BViewport
Category: Graphics-Windows
I am an host for whatever geometric shape you want. If you want to do some fancy graphics with Smalltalk, I'll be happy to help. My friends derived from BCanvasObject ask me all sort of things to do, so I am the real worker, not they!

BCanvasObject: I am BCanvas: No I am BCanvasObject: No I am BCanvas: No I am

well, you know, he always has something to object.


Next: , Up: BLOX.BCanvas

1.6.1 BLOX.BCanvas: accessing

backgroundColor
Answer the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


backgroundColor: value
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


foregroundColor
Answer the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


foregroundColor: value
Set the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


Next: , Previous: BLOX.BCanvas-accessing, Up: BLOX.BCanvas

1.6.2 BLOX.BCanvas: geometry management

addChild: child
The widget identified by child has been added to the receiver. This method is public not because you can call it, but because it can be useful to override it, not forgetting the call to either the superclass implementation or #basicAddChild:, to perform some initialization on the children just added. Answer the new child.


child: child height: value
Set the given child's height.


child: child heightOffset: value
Offset the given child's height by value pixels.


child: child width: value
Set the given child's width.


child: child widthOffset: value
Offset the given child's width by value pixels.


child: child x: value
Set the given child's top-left corner's x coordinate, in pixels in the canvas' coordinate system.


child: child xOffset: value
Offset the given child's top-left x by value pixels.


child: child y: value
Set the given child's top-left corner's y coordinate, in pixels in the canvas' coordinate system.


child: child yOffset: value
Offset the given child's top-left y by value pixels.


heightChild: child
Answer the given child's height in pixels.


widthChild: child
Answer the given child's width in pixels.


xChild: child
Answer the given child's top-left corner's x coordinate, in pixels in the canvas' coordinate system.


yChild: child
Answer the given child's top-left corner's y coordinate, in pixels in the canvas' coordinate system.


Previous: BLOX.BCanvas-geometry management, Up: BLOX.BCanvas

1.6.3 BLOX.BCanvas: widget protocol

at: aPoint
Selects the topmost item in the canvas overlapping the point given by aPoint.


between: origin and: corner do: aBlock
Evaluate aBlock for each item whose bounding box intersects the rectangle between the two Points, origin and corner. Pass the item to the block.


boundingBox
Answer the bounding box of all the items in the canvas


destroyed
The widget has been destroyed. Tell all of its items about this fact.


do: aBlock
Evaluate aBlock, passing each item to it.


empty
Remove all the items from the canvas, leaving it empty


extraSpace
Answer the amount of space that is left as a border around the canvas items.


extraSpace: aPoint
Set the amount of space that is left as a border around the canvas items.


items
Answer an Array containing all the items in the canvas


mapPoint: aPoint
Given aPoint, a point expressed in window coordinates, answer the corresponding canvas coordinates that are displayed at that location.


Next: , Previous: BLOX.BCanvas, Up: BLOX package

1.7 BLOX.BCanvasObject

Defined in namespace BLOX
Superclass: BLOX.BEventTarget
Category: Graphics-Windows
I am the ultimate ancestor of all items that you can put in a BCanvas. I provide some general methods to my concrete offspring.


Next: , Up: BLOX.BCanvasObject

1.7.1 BLOX.BCanvasObject class: instance creation

new
This method should not be called for instances of this class.


new: parentCanvas
Answer a new instance of the receiver, displayed into the given parentCanvas.


Next: , Previous: BLOX.BCanvasObject class-instance creation, Up: BLOX.BCanvasObject

1.7.2 BLOX.BCanvasObject: accessing

blox
Answer the parent canvas of the receiver


boundingBox
Answer a Rectangle enclosing all of the receiver


color
Answer the color to be used to fill this item's area.


color: color
Set the color to be used to fill this item's area.


copyInto: newCanvas
Answer a new BCanvasObject identical to this but displayed into another canvas, newCanvas. The new instance is not created at the time it is returned.


copyObject
Answer a new BCanvasObject identical to this. Unlike #copy, which merely creates a new Smalltalk object with the same data and referring to the same canvas item, the object created with #copyObject is physically distinct from the original. The new instance is not created at the time it is returned.


createCopy
Answer a new BCanvasObject identical to this. Unlike #copy, which merely creates a new Smalltalk object with the same data and referring to the same canvas item, the object created with #copyObject is physically distinct from the original. The new instance has already been created at the time it is returned.


createCopyInto: newCanvas
Answer a new BCanvasObject identical to this but displayed into another canvas, newCanvas. The new instance has already been created at the time it is returned.


deepCopy
It does not make sense to make a copy, because it would make data inconsistent across different objects; so answer the receiver


grayOut
Apply a 50% gray stippling pattern to the object


shallowCopy
It does not make sense to make a copy, because it would make data inconsistent across different objects; so answer the receiver


Previous: BLOX.BCanvasObject-accessing, Up: BLOX.BCanvasObject

1.7.3 BLOX.BCanvasObject: widget protocol

create
If the object has not been created yet and has been initialized correctly, insert it for real in the parent canvas


created
Answer whether the object is just a placeholder or has already been inserted for real in the parent canvas


lower
Move the item to the lowest position in the display list. Child widgets always obscure other item types, and the stacking order of window items is determined by sending methods to the widget object directly.


raise
Move the item to the highest position in the display list. Child widgets always obscure other item types, and the stacking order of window items is determined by sending methods to the widget object directly.


redraw
Force the object to be displayed in the parent canvas, creating it if it has not been inserted for real in the parent, and refresh its position if it has changed.


remove
Remove the object from the canvas


show
Ensure that the object is visible in the center of the canvas, scrolling it if necessary.


Next: , Previous: BLOX.BCanvasObject, Up: BLOX package

1.8 BLOX.BCheckMenuItem

Defined in namespace BLOX
Superclass: BLOX.BMenuItem
Category: Graphics-Windows
I am a menu item which can be toggled between two states, marked and unmarked.


Next: , Up: BLOX.BCheckMenuItem

1.8.1 BLOX.BCheckMenuItem class: instance creation

new: parent
This method should not be called for instances of this class.


Previous: BLOX.BCheckMenuItem class-instance creation, Up: BLOX.BCheckMenuItem

1.8.2 BLOX.BCheckMenuItem: accessing

invokeCallback
Generate a synthetic callback


value
Answer whether the menu item is in a selected (checked) state.


value: aBoolean
Set whether the button is in a selected (checked) state and generates a callback accordingly.


Next: , Previous: BLOX.BCheckMenuItem, Up: BLOX package

1.9 BLOX.BColorButton

Defined in namespace BLOX
Superclass: BLOX.BButtonLike
Category: Graphics-Examples
I am a button that shows a color and that, unless a different callback is used, lets you choose a color when it is clicked.


Up: BLOX.BColorButton

1.9.1 BLOX.BColorButton: accessing

color
Set the color that the receiver is painted in.


color: aString
Set the color that the receiver is painted in.


pressed
This is the default callback; it brings up a `choose-a-color' window and, if `Ok' is pressed in the window, sets the receiver to be painted in the chosen color.


Next: , Previous: BLOX.BColorButton, Up: BLOX package

1.10 BLOX.BContainer

Defined in namespace BLOX
Superclass: BLOX.BForm
Category: Graphics-Windows
I am used to group many widgets together. I can perform simple management by putting widgets next to each other, from left to right or from top to bottom.


Up: BLOX.BContainer

1.10.1 BLOX.BContainer: accessing

setVerticalLayout: aBoolean
Answer whether the container will align the widgets vertically or horizontally. Horizontal alignment means that widgets are packed from left to right, while vertical alignment means that widgets are packed from the top to the bottom of the widget.

Widgets that are set to be “stretched” will share all the space that is not allocated to non-stretched widgets.

The layout of the widget can only be set before the first child is inserted in the widget.


Next: , Previous: BLOX.BContainer, Up: BLOX package

1.11 BLOX.BDialog

Defined in namespace BLOX
Superclass: BLOX.BForm
Category: Graphics-Windows
I am a facility for implementing dialogs with many possible choices and requests. In addition I provide support for a few platform native common dialog boxes, such as choose-a-file and choose-a-color.


Next: , Up: BLOX.BDialog

1.11.1 BLOX.BDialog class: instance creation

new: parent
Answer a new dialog handler (containing a label widget and some button widgets) laid out within the given parent window. The label widget, when it is created, is empty.


new: parent label: aLabel
Answer a new dialog handler (containing a label widget and some button widgets) laid out within the given parent window. The label widget, when it is created, contains aLabel.


new: parent label: aLabel prompt: aString
Answer a new dialog handler (containing a label widget, some button widgets, and an edit window showing aString by default) laid out within the given parent window. The label widget, when it is created, contains aLabel.


Next: , Previous: BLOX.BDialog class-instance creation, Up: BLOX.BDialog

1.11.2 BLOX.BDialog class: prompters

chooseColor: parent label: aLabel default: color
Prompt for a color. The dialog box is created with the given parent window and with aLabel as its title bar text, and initially it selects the color given in the color parameter.

If the dialog box is canceled, nil is answered, else the selected color is returned as a String with its RGB value.


chooseFileToOpen: parent label: aLabel default: name defaultExtension: ext types: typeList
Pop up a dialog box for the user to select a file to open. Its purpose is for the user to select an existing file only. If the user enters an non-existent file, the dialog box gives the user an error prompt and requires the user to give an alternative selection or to cancel the selection. If an application allows the user to create new files, it should do so by providing a separate New menu command.

If the dialog box is canceled, nil is answered, else the selected file name is returned as a String.

The dialog box is created with the given parent window and with aLabel as its title bar text. The name parameter indicates which file is initially selected, and the default extension specifies a string that will be appended to the filename if the user enters a filename without an extension.

The typeList parameter is an array of arrays, like #(('Text files' '.txt' '.diz') ('Smalltalk files' '.st')), and is used to construct a listbox of file types. When the user chooses a file type in the listbox, only the files of that type are listed. Each item in the array contains a list of strings: the first one is the name of the file type described by a particular file pattern, and is the text string that appears in the File types listbox, while the other ones are the possible extensions that belong to this particular file type.


chooseFileToSave: parent label: aLabel default: name defaultExtension: ext types: typeList
Pop up a dialog box for the user to select a file to save; this differs from the file open dialog box in that non-existent file names are accepted and existing file names trigger a confirmation dialog box, asking the user whether the file should be overwritten or not.

If the dialog box is canceled, nil is answered, else the selected file name is returned as a String.

The dialog box is created with the given parent window and with aLabel as its title bar text. The name parameter indicates which file is initially selected, and the default extension specifies a string that will be appended to the filename if the user enters a filename without an extension.

The typeList parameter is an array of arrays, like #(('Text files' '.txt' '.diz') ('Smalltalk files' '.st')), and is used to construct a listbox of file types. When the user chooses a file type in the listbox, only the files of that type are listed. Each item in the array contains a list of strings: the first one is the name of the file type described by a particular file pattern, and is the text string that appears in the File types listbox, while the other ones are the possible extensions that belong to this particular file type.


Next: , Previous: BLOX.BDialog class-prompters, Up: BLOX.BDialog

1.11.3 BLOX.BDialog: accessing

addButton: aLabel receiver: anObject index: anInt
Add a button to the dialog box that, when clicked, will cause the #dispatch: method to be triggered in anObject, passing anInt as the argument of the callback. The caption of the button is set to aLabel.


addButton: aLabel receiver: anObject message: aSymbol
Add a button to the dialog box that, when clicked, will cause the aSymbol unary selector to be sent to anObject. The caption of the button is set to aLabel.


addButton: aLabel receiver: anObject message: aSymbol argument: arg
Add a button to the dialog box that, when clicked, will cause the aSymbol one-argument selector to be sent to anObject, passing arg as the argument of the callback. The caption of the button is set to aLabel.


contents
Answer the text that is displayed in the entry widget associated to the dialog box.


contents: newText
Display newText in the entry widget associated to the dialog box.


Previous: BLOX.BDialog-accessing, Up: BLOX.BDialog

1.11.4 BLOX.BDialog: widget protocol

center
Center the dialog box's parent window in the screen


centerIn: view
Center the dialog box's parent window in the given widget


destroyed
Private - The receiver has been destroyed, clear the corresponding Tcl variable to avoid memory leaks.


invokeCallback: index
Generate a synthetic callback corresponding to the index-th button being pressed, and destroy the parent window (triggering its callback if one was established).


loop
Map the parent window modally. In other words, an event loop is started that ends only after the window has been destroyed. For more information on the treatment of events for modal windows, refer to BWindow>>#modalMap.


Next: , Previous: BLOX.BDialog, Up: BLOX package

1.12 BLOX.BDropDown

Defined in namespace BLOX
Superclass: BLOX.BExtended
Category: Graphics-Examples
This class is an abstract superclass for widgets offering the ability to pick items from a pre-built list. The list is usually hidden, but a button on the right of this widgets makes it pop up. This widget is thus composed of three parts: an unspecified text widget (shown on the left of the button and always visible), the button widget (shown on the right, it depicts a down arrow, and is always visible), and the pop-up list widget.


Next: , Up: BLOX.BDropDown

1.12.1 BLOX.BDropDown: accessing

backgroundColor
Answer the value of the backgroundColor for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the normal background color to use when displaying the widget.


backgroundColor: aColor
Set the value of the backgroundColor for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the normal background color to use when displaying the widget.


droppedRows
Answer the number of items that are visible at any time in the listbox.


droppedRows: anInteger
Set the number of items that are visible at any time in the listbox.


font
Answer the value of the font option for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


font: value
Set the value of the font option for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


foregroundColor
Answer the value of the foregroundColor for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the normal foreground color to use when displaying the widget.


foregroundColor: aColor
Set the value of the foregroundColor for the widget, which in this class is only set for the list widget (that is, the pop-up widget). Subclasses should override this method so that the color is set properly for the text widget as well.

Specifies the normal foreground color to use when displaying the widget.


highlightBackground
Answer the value of the highlightBackground option for the widget.

Specifies the background color to use when displaying selected items in the list widget.


highlightBackground: aColor
Set the value of the highlightBackground option for the widget.

Specifies the background color to use when displaying selected items in the list widget.


highlightForeground
Answer the value of the highlightForeground option for the widget.

Specifies the foreground color to use when displaying selected items in the list widget.


highlightForeground: aColor
Set the value of the highlightForeground option for the widget.

Specifies the foreground color to use when displaying selected items in the list widget.


Next: , Previous: BLOX.BDropDown-accessing, Up: BLOX.BDropDown

1.12.2 BLOX.BDropDown: callbacks

callback
Answer a DirectedMessage that is sent when the receiver is clicked, or nil if none has been set up.


callback: aReceiver message: aSymbol
Set up so that aReceiver is sent the aSymbol message (the name of a zero- or one-argument selector) when the receiver is clicked. If the method accepts an argument, the receiver is passed.


invokeCallback
Generate a synthetic callback


Next: , Previous: BLOX.BDropDown-callbacks, Up: BLOX.BDropDown

1.12.3 BLOX.BDropDown: flexibility

createList
Create the popup widget to be used for the `drop-down list'. It is a BList by default, but you can use any other widget, overriding the `list box accessing' methods if necessary.


createTextWidget
Create the widget that will hold the string chosen from the list box and answer it. The widget must be a child of `self primitive'.


itemHeight
Answer the height of an item in the drop-down list. The default implementation assumes that the receiver understands #font, but you can modify it if you want.


listCallback
Called when an item of the listbox is highlighted. Do nothing by default


listSelectAt: aPoint
Select the item lying at the given position in the list box. The default implementation assumes that list is a BList, but you can modify it if you want.


listText
Answer the text currently chosen in the list box. The default implementation assumes that list is a BList, but you can modify it if you want.


text
Answer the text that the user has picked from the widget and/or typed in the control (the exact way the text is entered will be established by subclasses, since this is an abstract method).


text: aString
Set the text widget to aString


Next: , Previous: BLOX.BDropDown-flexibility, Up: BLOX.BDropDown

1.12.4 BLOX.BDropDown: list box accessing

add: anObject afterIndex: index
Add an element with the given value after another element whose index is contained in the index parameter. The label displayed in the widget is anObject's displayString. Answer anObject.


add: aString element: anObject afterIndex: index
Add an element with the aString label after another element whose index is contained in the index parameter. This method allows the client to decide autonomously the label that the widget will display.

If anObject is nil, then string is used as the element as well. If aString is nil, then the element's displayString is used as the label.

Answer anObject or, if it is nil, aString.


addLast: anObject
Add an element with the given value at the end of the listbox. The label displayed in the widget is anObject's displayString. Answer anObject.


addLast: aString element: anObject
Add an element with the given value at the end of the listbox. This method allows the client to decide autonomously the label that the widget will display.

If anObject is nil, then string is used as the element as well. If aString is nil, then the element's displayString is used as the label.

Answer anObject or, if it is nil, aString.


associationAt: anIndex
Answer an association whose key is the item at the given position in the listbox and whose value is the label used to display that item.


at: anIndex
Answer the element displayed at the given position in the list box.


contents: stringCollection
Set the elements displayed in the listbox, and set the labels to be their displayStrings.


contents: stringCollection elements: elementList
Set the elements displayed in the listbox to be those in elementList, and set the labels to be the corresponding elements in stringCollection. The two collections must have the same size.


do: aBlock
Iterate over each element of the listbox and pass it to aBlock.


elements: elementList
Set the elements displayed in the listbox, and set the labels to be their displayStrings.


index: newIndex
Highlight the item at the given position in the listbox, and transfer the text in the list box to the text widget.


labelAt: anIndex
Answer the label displayed at the given position in the list box.


labelsDo: aBlock
Iterate over the labels in the list widget and pass each of them to aBlock.


numberOfStrings
Answer the number of items in the list box

would

removeAtIndex: index
Remove the item at the given index in the list box, answering the object associated to the element (i.e. the value that #at: would have returned for the given index)


size
Answer the number of items in the list box


Previous: BLOX.BDropDown-list box accessing, Up: BLOX.BDropDown

1.12.5 BLOX.BDropDown: widget protocol

dropRectangle
Answer the rectangle in which the list widget will pop-up. If possible, this is situated below the drop-down widget's bottom side, but if the screen space there is not enough it could be above the drop-down widget's above side. If there is no screen space above as well, we pick the side where we can offer the greatest number of lines in the pop-up widget.


dropdown
Force the pop-up list widget to be visible.


isDropdownVisible
Answer whether the pop-up widget is visible


toggle
Toggle the visibility of the pop-up widget.


unmapList
Unmap the pop-up widget from the screen, transfer its selected item to the always visible text widget, and generate a callback.


Next: , Previous: BLOX.BDropDown, Up: BLOX package

1.13 BLOX.BDropDownEdit

Defined in namespace BLOX
Superclass: BLOX.BDropDown
Category: Graphics-Examples
This class resembles an edit widget, but it has an arrow button that allows the user to pick an item from a pre-built list.


Next: , Up: BLOX.BDropDownEdit

1.13.1 BLOX.BDropDownEdit: accessing

backgroundColor: aColor
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


font: aString
Set the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


foregroundColor: aColor
Set the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


highlightBackground: aColor
Set the value of the highlightBackground option for the widget.

Specifies the background color to use when displaying selected items in the list widget and the selection in the text widget.


highlightForeground: aColor
Set the value of the highlightBackground option for the widget.

Specifies the background color to use when displaying selected items in the list widget and the selection in the text widget.


Next: , Previous: BLOX.BDropDownEdit-accessing, Up: BLOX.BDropDownEdit

1.13.2 BLOX.BDropDownEdit: accessing-overrides

text
Answer the text shown in the widget


Previous: BLOX.BDropDownEdit-accessing-overrides, Up: BLOX.BDropDownEdit

1.13.3 BLOX.BDropDownEdit: text accessing

insertAtEnd: aString
Clear the selection and append aString at the end of the text widget.


replaceSelection: aString
Insert aString in the text widget at the current insertion point, replacing the currently selected text (if any), and leaving the text selected.


selectAll
Select the whole contents of the text widget


selectFrom: first to: last
Sets the selection of the text widget to include the characters starting with the one indexed by first (the very first character in the widget having index 1) and ending with the one just before last. If last refers to the same character as first or an earlier one, then the text widget's selection is cleared.


selection
Answer an empty string if the text widget has no selection, else answer the currently selected text


selectionRange
Answer nil if the text widget has no selection, else answer an Interval object whose first item is the index of the first character in the selection, and whose last item is the index of the character just after the last one in the selection.


text: aString
Set the contents of the text widget and select them.


Next: , Previous: BLOX.BDropDownEdit, Up: BLOX package

1.14 BLOX.BDropDownList

Defined in namespace BLOX
Superclass: BLOX.BDropDown
Category: Graphics-Examples
This class resembles a list box widget, but its actual list shows up only when you click the arrow button beside the currently selected item.


Next: , Up: BLOX.BDropDownList

1.14.1 BLOX.BDropDownList: accessing

backgroundColor: aColor
Set the value of the backgroundColor for the widget, which in this class is set for the list widget and, when the focus is outside the control, for the text widget as well.

Specifies the normal background color to use when displaying the widget.


font: aString
Set the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


foregroundColor: aColor
Set the value of the foregroundColor for the widget, which in this class is set for the list widget and, when the focus is outside the control, for the text widget as well.

Specifies the normal foreground color to use when displaying the widget.


highlightBackground: aColor
Answer the value of the highlightBackground option for the widget.

Specifies the background color to use when displaying selected items in the list widget and, when the focus is inside the control, for the text widget as well.


highlightForeground: aColor
Answer the value of the highlightForeground option for the widget.

Specifies the foreground color to use when displaying selected items in the list widget and, when the focus is inside the control, for the text widget as well.


text
Answer the text that the user has picked from the widget and/or typed in the control (the exact way the text is entered will be established by subclasses, since this is an abstract method).


Next: , Previous: BLOX.BDropDownList-accessing, Up: BLOX.BDropDownList

1.14.2 BLOX.BDropDownList: callbacks

callback: aReceiver message: aSymbol
Set up so that aReceiver is sent the aSymbol message (the name of a selector with at most two arguemtnts) when the active item in the receiver changegs. If the method accepts two arguments, the receiver is passed as the first parameter. If the method accepts one or two arguments, the selected index is passed as the last parameter.


invokeCallback
Generate a synthetic callback.


Previous: BLOX.BDropDownList-callbacks, Up: BLOX.BDropDownList

1.14.3 BLOX.BDropDownList: list box accessing

index
Answer the value of the index option for the widget. Since it is not possible to modify an item once it has been picked from the list widget, this is always defined for BDropDownList widgets.


Next: , Previous: BLOX.BDropDownList, Up: BLOX package

1.15 BLOX.BEdit

Defined in namespace BLOX
Superclass: BLOX.BPrimitive
Category: Graphics-Windows
I am a widget showing one line of modifiable text.


Next: , Up: BLOX.BEdit

1.15.1 BLOX.BEdit class: instance creation

new: parent contents: aString
Answer a new BEdit widget laid inside the given parent widget, with a default content of aString


Next: , Previous: BLOX.BEdit class-instance creation, Up: BLOX.BEdit

1.15.2 BLOX.BEdit: accessing

backgroundColor
Answer the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


backgroundColor: value
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


callback
Answer a DirectedMessage that is sent when the receiver is modified, or nil if none has been set up.


callback: aReceiver message: aSymbol
Set up so that aReceiver is sent the aSymbol message (the name of a zero- or one-argument selector) when the receiver is modified. If the method accepts an argument, the receiver is passed.


contents
Return the contents of the widget


contents: newText
Set the contents of the widget


font
Answer the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


font: value
Set the value of the font option for the widget.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


foregroundColor
Answer the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


foregroundColor: value
Set the value of the foregroundColor option for the widget.

Specifies the normal foreground color to use when displaying the widget.


selectBackground
Answer the value of the selectBackground option for the widget.

Specifies the background color to use when displaying selected parts of the widget.


selectBackground: value
Set the value of the selectBackground option for the widget.

Specifies the background color to use when displaying selected parts of the widget.


selectForeground
Answer the value of the selectForeground option for the widget.

Specifies the foreground color to use when displaying selected parts of the widget.


selectForeground: value
Set the value of the selectForeground option for the widget.

Specifies the foreground color to use when displaying selected parts of the widget.


Previous: BLOX.BEdit-accessing, Up: BLOX.BEdit

1.15.3 BLOX.BEdit: widget protocol

destroyed
Private - The receiver has been destroyed, clear the corresponding Tcl variable to avoid memory leaks.


hasSelection
Answer whether there is selected text in the widget


insertAtEnd: aString
Clear the selection and append aString at the end of the widget.


insertText: aString
Insert aString in the widget at the current insertion point, replacing the currently selected text (if any).


invokeCallback
Generate a synthetic callback.


nextPut: aCharacter
Clear the selection and append aCharacter at the end of the widget.


nextPutAll: aString
Clear the selection and append aString at the end of the widget.


nl
Clear the selection and append a linefeed character at the end of the widget.


replaceSelection: aString
Insert aString in the widget at the current insertion point, replacing the currently selected text (if any), and leaving the text selected.


selectAll
Select the whole contents of the widget.


selectFrom: first to: last
Sets the selection to include the characters starting with the one indexed by first (the very first character in the widget having index 1) and ending with the one just before last. If last refers to the same character as first or an earlier one, then the widget's selection is cleared.


selection
Answer an empty string if the widget has no selection, else answer the currently selected text


selectionRange
Answer nil if the widget has no selection, else answer an Interval object whose first item is the index of the first character in the selection, and whose last item is the index of the character just after the last one in the selection.


space
Clear the selection and append a space at the end of the widget.


Next: , Previous: BLOX.BEdit, Up: BLOX package

1.16 BLOX.BEmbeddedImage

Defined in namespace BLOX
Superclass: BLOX.BBoundingBox
Category: Graphics-Windows
I can draw a colorful image inside the canvas.


Up: BLOX.BEmbeddedImage

1.16.1 BLOX.BEmbeddedImage: accessing

copyInto: aBlox
Answer a new BCanvasObject identical to this but displayed into another canvas, newCanvas. The new instance is not created at the time it is returned.


data
Answer the data of the image. The result will be a String containing image data either as Base-64 encoded GIF data, as XPM data, or as PPM data.


data: aString
Set the data of the image. aString may contain the data either as Base-64 encoded GIF data, as XPM data, or as PPM data. No changes are visible until you toggle a redraw using the appropriate method.


redraw
Force the object to be displayed in the parent canvas, creating it if it has not been inserted for real in the parent, and refresh its position and image data if it has changed.


Next: , Previous: BLOX.BEmbeddedImage, Up: BLOX package

1.17 BLOX.BEmbeddedText

Defined in namespace BLOX
Superclass: BLOX.BBoundingBox
Category: Graphics-Windows
I can draw text in all sorts of colors, sizes and fonts.


Up: BLOX.BEmbeddedText

1.17.1 BLOX.BEmbeddedText: accessing

font
Answer the value of the font option for the canvas object.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


font: font
Set the value of the font option for the canvas object.

Specifies the font to use when drawing text inside the widget. The font can be given as either an X font name or a Blox font description string.

X font names are given as many fields, each led by a minus, and each of which can be replaced by an * to indicate a default value is ok: foundry, family, weight, slant, setwidth, addstyle, pixel size, point size (the same as pixel size for historical reasons), horizontal resolution, vertical resolution, spacing, width, charset and character encoding.

Blox font description strings have three fields, which must be separated by a space and of which only the first is mandatory: the font family, the font size in points (or in pixels if a negative value is supplied), and a number of styles separated by a space (valid styles are normal, bold, italic, underline and overstrike). Examples of valid fonts are “Helvetica 10 Bold”, “Times -14”, “Futura Bold Underline”. You must enclose the font family in braces if it is made of two or more words.


justify
Answer how to justify the text within its bounding region.


justify: aSymbol
Sets how to justify the text within its bounding region. Can be #left, #right or #center (the default).


redraw
Force the object to be displayed in the parent canvas, creating it if it has not been inserted for real in the parent, and refresh its position.


text
Answer the text that is printed by the object


text: aString
Set the text that is printed by the object


Next: , Previous: BLOX.BEmbeddedText, Up: BLOX package

1.18 BLOX.BEventSet

Defined in namespace BLOX
Superclass: BLOX.BEventTarget
Category: Graphics-Windows
I combine event handlers and let you apply them to many objects. Basically, you derive a class from me, override the #initialize: method to establish the handlers, then use the #addEventSet: method understood by every Blox class to add the event handlers specified by the receiver to the object.


Next: , Up: BLOX.BEventSet

1.18.1 BLOX.BEventSet class: initializing

new
This method should not be called for instances of this class.


new: widget
Private - Create a new event set object that will attach to the given widget. Answer the object. Note: this method should be called by #addEventSet:, not directly


Next: , Previous: BLOX.BEventSet class-initializing, Up: BLOX.BEventSet

1.18.2 BLOX.BEventSet: accessing

widget
Answer the widget to which the receiver is attached.


Previous: BLOX.BEventSet-accessing, Up: BLOX.BEventSet

1.18.3 BLOX.BEventSet: initializing

initialize: aBWidget
Initialize the receiver's event handlers to attach to aBWidget. You can override this of course, but don't forget to call the superclass implementation first.


Next: , Previous: BLOX.BEventSet, Up: BLOX package

1.19 BLOX.BEventTarget

Defined in namespace BLOX
Superclass: Object
Category: Graphics-Windows
I track all the event handling procedures that you apply to an object.


Up: BLOX.BEventTarget

1.19.1 BLOX.BEventTarget: intercepting events

addEventSet: aBEventSetSublass
Add to the receiver the event handlers implemented by an instance of aBEventSetSubclass. Answer the new instance of aBEventSetSublass.


onAsciiKeyEventSend: aSelector to: anObject
When an ASCII key is pressed and the receiver has the focus, send the 1-argument message identified by aSelector to anObject, passing to it a Character.


onDestroySend: aSelector to: anObject
When the receiver is destroyed, send the unary message identified by aSelector to anObject.


onFocusEnterEventSend: aSelector to: anObject
When the focus enters the receiver, send the unary message identified by aSelector to anObject.


onFocusLeaveEventSend: aSelector to: anObject
When the focus leaves the receiver, send the unary message identified by aSelector to anObject.


onKeyEvent: key send: aSelector to: anObject
When the given key is pressed and the receiver has the focus, send the unary message identified by aSelector to anObject. Examples for key are: 'Ctrl-1', 'Alt-X', 'Meta-plus', 'enter'. The last two cases include example of special key identifiers; these include: 'backslash', 'exclam', 'quotedbl', 'dollar', 'asterisk', 'less', 'greater', 'asciicircum' (caret), 'question', 'equal', 'parenleft', 'parenright', 'colon', 'semicolon', 'bar' (pipe sign), 'underscore', 'percent', 'minus', 'plus', 'BackSpace', 'Delete', 'Insert', 'Return', 'End', 'Home', 'Prior' (Pgup), 'Next' (Pgdn), 'F1'..'F24', 'Caps_Lock', 'Num_Lock', 'Tab', 'Left', 'Right', 'Up', 'Down'. There are in addition four special identifiers which map to platform-specific keys: '<Cut>', '<Copy>', '<Paste>', '<Clear>' (all with the angular brackets!).

test

onKeyEventSend: aSelector to: anObject
When a key is pressed and the receiver has the focus, send the 1-argument message identified by aSelector to anObject. The pressed key will be passed as a String parameter; some of the keys will send special key identifiers such as those explained in the documentation for #onKeyEvent:send:to: Look at the #eventTest test program in the BloxTestSuite to find out the parameters passed to such an event procedure

test

onKeyUpEventSend: aSelector to: anObject
When a key has been released and the receiver has the focus, send the 1-argument message identified by aSelector to anObject. The released key will be passed as a String parameter; some of the keys will send special key identifiers such as those explained in the documentation for #onKeyEvent:send:to: Look at the #eventTest test program in the BloxTestSuite to find out the parameters passed to such an event procedure


onMouseDoubleEvent: button send: aSelector to: anObject
When the given button is double-clicked on the mouse, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseDoubleEventSend: aSelector to: anObject
When a button is double-clicked on the mouse, send the 2-argument message identified by aSelector to anObject. The mouse position will be passed as a Point in the first parameter, the button number will be passed as an Integer in the second parameter.


onMouseDownEvent: button send: aSelector to: anObject
When the given button is pressed on the mouse, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseDownEventSend: aSelector to: anObject
When a button is pressed on the mouse, send the 2-argument message identified by aSelector to anObject. The mouse position will be passed as a Point in the first parameter, the button number will be passed as an Integer in the second parameter.


onMouseEnterEventSend: aSelector to: anObject
When the mouse enters the widget, send the unary message identified by aSelector to anObject.


onMouseLeaveEventSend: aSelector to: anObject
When the mouse leaves the widget, send the unary message identified by aSelector to anObject.


onMouseMoveEvent: button send: aSelector to: anObject
When the mouse is moved while the given button is pressed on the mouse, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseMoveEventSend: aSelector to: anObject
When the mouse is moved, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseTripleEvent: button send: aSelector to: anObject
When the given button is triple-clicked on the mouse, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseTripleEventSend: aSelector to: anObject
When a button is triple-clicked on the mouse, send the 2-argument message identified by aSelector to anObject. The mouse position will be passed as a Point in the first parameter, the button number will be passed as an Integer in the second parameter.


onMouseUpEvent: button send: aSelector to: anObject
When the given button is released on the mouse, send the 1-argument message identified by aSelector to anObject. The mouse position will be passed as a Point.


onMouseUpEventSend: aSelector to: anObject
When a button is released on the mouse, send the 2-argument message identified by aSelector to anObject. The mouse position will be passed as a Point in the first parameter, the button number will be passed as an Integer in the second parameter.


onResizeSend: aSelector to: anObject
When the receiver is resized, send the 1-argument message identified by aSelector to anObject. The new size will be passed as a Point.


Next: , Previous: BLOX.BEventTarget, Up: BLOX package

1.20 BLOX.BExtended

Defined in namespace BLOX
Superclass: BLOX.BWidget
Category: Graphics-Windows
Just like Gui, I serve as a base for complex objects which expose an individual protocol but internally use a Blox widget for creating their user interface. Unlike Gui, however, the instances of my subclasses understand the standard widget protocol. Just override my newPrimitive method to return another widget, and you'll get a class which interacts with the user like that widget (a list box, a text box, or even a label) but exposes a different protocol.


Next: , Up: BLOX.BExtended

1.20.1 BLOX.BExtended: accessing

asPrimitiveWidget
Answer the primitive widget that implements the receiver.


Previous: BLOX.BExtended-accessing, Up: BLOX.BExtended

1.20.2 BLOX.BExtended: customization

create
After this method is called (the call is made automatically) the receiver will be attached to a `primitive' widget (which can be in turn another extended widget). This method is public not because you can call it, but because it can be useful to override it, not forgetting the call to super (which only calls #newPrimitive and saves the result), to perform some initialization on the primitive widget just created; overriding #create is in fact more generic than overriding #newPrimitive. For an example of this, see the implementation of BButtonLike.


newPrimitive
Create and answer a new widget on which the implementation of the receiver will be based. You should not call this method directly; instead you must override it in BExtended's subclasses.


Next: , Previous: BLOX.BExtended, Up: BLOX package

1.21 BLOX.BForm

Defined in namespace BLOX
Superclass: BLOX.BPrimitive
Category: Graphics-Windows
I am used to group many widgets together. I leave the heavy task of managing their position to the user.


Up: BLOX.BForm

1.21.1 BLOX.BForm: accessing

backgroundColor
Answer the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


backgroundColor: value
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


defaultHeight
Answer the value of the defaultHeight option for the widget.

Specifies the desired height for the form in pixels. If this option is less than or equal to zero then the window will not request any size at all.


defaultHeight: value
Set the value of the defaultHeight option for the widget.

Specifies the desired height for the form in pixels. If this option is less than or equal to zero then the window will not request any size at all.


defaultWidth
Answer the value of the defaultWidth option for the widget.

Specifies the desired width for the form in pixels. If this option is less than or equal to zero then the window will not request any size at all.


defaultWidth: value
Set the value of the defaultWidth option for the widget.

Specifies the desired width for the form in pixels. If this option is less than or equal to zero then the window will not request any size at all.


Next: , Previous: BLOX.BForm, Up: BLOX package

1.22 BLOX.BImage

Defined in namespace BLOX
Superclass: BLOX.BPrimitive
Category: Graphics-Windows
I can display colorful images.


Next: , Up: BLOX.BImage

1.22.1 BLOX.BImage class: arrows

downArrow
Answer the XPM representation of a 12x12 arrow pointing downwards.


leftArrow
Answer the XPM representation of a 12x12 arrow pointing leftwards.


rightArrow
Answer the XPM representation of a 12x12 arrow pointing rightwards.


upArrow
Answer the XPM representation of a 12x12 arrow pointing upwards.


Next: , Previous: BLOX.BImage class-arrows, Up: BLOX.BImage

1.22.2 BLOX.BImage class: GNU

gnu
Answer the XPM representation of a 48x48 GNU.


Next: , Previous: BLOX.BImage class-GNU, Up: BLOX.BImage

1.22.3 BLOX.BImage class: icons

exclaim
Answer the XPM representation of a 32x32 exclamation mark icon.


info
Answer the XPM representation of a 32x32 `information' icon.


question
Answer the XPM representation of a 32x32 question mark icon.


stop
Answer the XPM representation of a 32x32 `critical stop' icon.


Next: , Previous: BLOX.BImage class-icons, Up: BLOX.BImage

1.22.4 BLOX.BImage class: instance creation

new: parent data: aString
Answer a new BImage widget laid inside the given parent widget, loading data from the given string (Base-64 encoded GIF, XPM, PPM are supported).


new: parent image: aFileStream
Answer a new BImage widget laid inside the given parent widget, loading data from the given file (GIF, XPM, PPM are supported).


new: parent size: aPoint
Answer a new BImage widget laid inside the given parent widget, showing by default a transparent image of aPoint size.


Next: , Previous: BLOX.BImage class-instance creation, Up: BLOX.BImage

1.22.5 BLOX.BImage class: small icons

directory
Answer the Base-64 GIF representation of a `directory folder' icon.


file
Answer the Base-64 GIF representation of a `file' icon.


Next: , Previous: BLOX.BImage class-small icons, Up: BLOX.BImage

1.22.6 BLOX.BImage: accessing

backgroundColor
Answer the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


backgroundColor: value
Set the value of the backgroundColor option for the widget.

Specifies the normal background color to use when displaying the widget.


displayHeight
Answer the value of the displayHeight option for the widget.

Specifies the height of the image in pixels. This is not the height of the widget, but specifies the area of the widget that will be taken by the image.


displayHeight: value
Set the value of the displayHeight option for the widget.

Specifies the height of the image in pixels. This is not the height of the widget, but specifies the area of the widget that will be taken by the image.


displayWidth
Answer the value of the displayWidth option for the widget.

Specifies the width of the image in pixels. This is no