Back: BLOX.BList-widget protocol Up: BLOX package Forward: BLOX.Blox class-C call-outs   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.26 BLOX.Blox

Defined in namespace BLOX
Superclass: BLOX.BEventTarget
Category: Graphics-Windows
I am the superclass for every visible user interface object (excluding canvas items, which are pretty different). I provide common methods and a simple Tcl interface for internal use. In addition, I expose class methods that do many interesting event-handling things.

NOTE: some of the methods (notably geometry methods) may not be suitable for all Blox subclasses and may be included only for backwards compatibility towards 1.1.5 BLOX. You should use geometry methods only for subclasses of BWidget.

1.26.1 BLOX.Blox class: C call-outs  (class)
1.26.2 BLOX.Blox class: event dispatching  (class)
1.26.3 BLOX.Blox class: instance creation  (class)
1.26.4 BLOX.Blox class: utility  (class)
1.26.5 BLOX.Blox: accessing  (instance)
1.26.6 BLOX.Blox: basic  (instance)
1.26.7 BLOX.Blox: creating children  (instance)
1.26.8 BLOX.Blox: customization  (instance)
1.26.9 BLOX.Blox: widget protocol  (instance)


1.26.1 BLOX.Blox class: C call-outs

evalIn: interp tcl: cmd
Not commented.

idle
Not commented.

resultIn: interp
Not commented.

tclInit
Not commented.


1.26.2 BLOX.Blox class: event dispatching

dispatchEvents
If this is the outermost dispatching loop that is started, dispatch events until the number of calls to #terminateMainLoop balances the number of calls to #dispatchEvents; return instantly if this is not the outermost dispatching loop that is started.

dispatchEvents: mainWindow
Dispatch some events; return upon destruction of the `mainWindow' widget (which can be any kind of BWidget, but will be typically a BWindow).

terminateMainLoop
Terminate the event dispatching loop if this call to #terminateMainLoop balances the number of calls to #dispatchEvents.

update: aspect
Initialize the Tcl and Blox environments; executed automatically on startup.


1.26.3 BLOX.Blox class: instance creation

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

new: parent
Create a new widget of the type identified by the receiver, inside the given parent widget. Answer the new widget


1.26.4 BLOX.Blox class: utility

active
Answer the currently active Blox, or nil if the focus does not belong to a Smalltalk window.

at: aPoint
Answer the Blox containing the given point on the screen, or nil if no Blox contains the given point (either because no Smalltalk window is there or because it is covered by another window).

atMouse
Answer the Blox under the mouse cursor's hot spot, or nil if no Blox contains the given point (either because no Smalltalk window is there or because it is covered by another window).

beep
Produce a bell

clearClipboard
Clear the clipboard, answer its old contents.

clipboard
Retrieve the text in the clipboard.

clipboard: aString
Set the contents of the clipboard to aString (or empty the clipboard if aString is nil).

createColor: red green: green blue: blue
Answer a color that can be passed to methods such as `backgroundColor:'. The color will have the given RGB components (range is 0~65535).

createColor: cyan magenta: magenta yellow: yellow
Answer a color that can be passed to methods such as `backgroundColor:'. The color will have the given CMY components (range is 0~65535).

createColor: cyan magenta: magenta yellow: yellow black: black
Answer a color that can be passed to methods such as `backgroundColor:'. The color will have the given CMYK components (range is 0~65535).

createColor: hue saturation: sat value: value
Answer a color that can be passed to methods such as `backgroundColor:'. The color will have the given HSV components (range is 0~65535).

defaultFont
Answer the default font used by Blox.

fonts
Answer the names of the font families in the system. Additionally, `Times', `Courier' and `Helvetica' are always made available.

mousePointer
If the mouse pointer is on the same screen as the application's windows, returns a Point containing the pointer's x and y coordinates measured in pixels in the screen's root window (under X, if a virtual root window is in use on the screen, the position is computed in the whole desktop, not relative to the top-left corner of the currently shown portion). If the mouse pointer isn't on the same screen as window then answer nil.

platform
Answer the platform on which Blox is running; it can be either #unix, #macintosh or #windows.

screenOrigin
Answer a Point indicating the coordinates of the upper left point of the screen in the virtual root window on which the application's windows are drawn (under Windows and the Macintosh, that's always 0 @ 0)

screenResolution
Answer a Point containing the resolution in dots per inch of the screen, in the x and y directions.

screenSize
Answer a Point containing the size of the virtual root window on which the application's windows are drawn (under Windows and the Macintosh, that's the size of the screen)


1.26.5 BLOX.Blox: accessing

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

Specifies one of three states for the button: normal, active, or disabled. In normal state the button is displayed using the foreground and background options. The active state is typically used when the pointer is over the button. In active state the button is displayed using the activeForeground and activeBackground options. Disabled state means that the button should be insensitive: the application will refuse to activate the widget and will ignore mouse button presses.

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

Specifies one of three states for the button: normal, active, or disabled. In normal state the button is displayed using the foreground and background options. The active state is typically used when the pointer is over the button. In active state the button is displayed using the activeForeground and activeBackground options. Disabled state means that the button should be insensitive: the application will refuse to activate the widget and will ignore mouse button presses.


1.26.6 BLOX.Blox: basic

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

release
Destroy the receiver if it still exists, then perform the usual task of removing the dependency links

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


1.26.7 BLOX.Blox: creating children

make: array
Create children of the receiver. Answer a Dictionary of the children. Each element of array is an Array including: a string which becomes the Dictionary's key, a binding like #{Blox.BWindow} identifying the class name, an array with the parameters to be set (for example #(#width: 50 #height: 30 #backgroundColor: 'blue')), and afterwards the children of the widget, described as arrays with this same format.

make: array on: result
Private - Create children of the receiver, adding them to result; answer result. array has the format described in the comment to #make:

makeChild: each on: result
Private - Create a child of the receiver, adding them to result; each is a single element of the array described in the comment to #make:


1.26.8 BLOX.Blox: customization

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.

basicAddChild: child
The widget identified by child has been added to the receiver. Add it to the children collection and answer the new child. This method is public because you can call it from #addChild:.


1.26.9 BLOX.Blox: widget protocol

asPrimitiveWidget
Answer the primitive widget that implements the receiver.

childrenCount
Answer how many children the receiver has

childrenDo: aBlock
Evaluate aBlock once for each of the receiver's child widgets, passing the widget to aBlock as a parameter

destroy
Destroy the receiver

drawingArea
Answer a Rectangle identifying the receiver's drawing area. The rectangle's corners specify the upper-left and lower-right corners of the client area. Because coordinates are relative to the upper-left corner of a window's drawing area, the coordinates of the rectangle's corner are (0,0).

enabled
Answer whether the receiver is enabled to input. Although defined here, this method is only used for widgets that define a #state method

enabled: enabled
Set whether the receiver is enabled to input (enabled is a boolean). Although defined here, this method is only used for widgets that define a #state: method

exists
Answer whether the receiver has been destroyed or not (answer false in the former case, true in the latter).

fontHeight: aString
Answer the height of aString in pixels, when displayed in the same font as the receiver. Although defined here, this method is only used for widgets that define a #font method

fontWidth: aString
Answer the width of aString in pixels, when displayed in the same font as the receiver. Although defined here, this method is only used for widgets that define a #font method

isWindow
Answer whether the receiver represents a window on the screen.

parent
Answer the receiver's parent (or nil for a top-level window).

toplevel
Answer the top-level object (typically a BWindow or BPopupWindow) connected to the receiver.

window
Answer the window in which the receiver stays. Note that while #toplevel won't answer a BTransientWindow, this method will.

withChildrenDo: aBlock
Evaluate aBlock passing the receiver, and then once for each of the receiver's child widgets.



Back: BLOX.Blox-customization Up: BLOX.Blox Forward: BLOX.BMenu   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on April, 16 2013 using texi2html