Back: BLOX.BViewport-scrollbars Up: BLOX package Forward: BLOX.BWidget class-popups   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.49 BLOX.BWidget

Defined in namespace BLOX
Superclass: BLOX.Blox
Category: Graphics-Windows
I am the superclass for every widget except those related to menus. I provide more common methods and geometry management

1.49.1 BLOX.BWidget class: popups  (class)
1.49.2 BLOX.BWidget: accessing  (instance)
1.49.3 BLOX.BWidget: customization  (instance)
1.49.4 BLOX.BWidget: geometry management  (instance)
1.49.5 BLOX.BWidget: widget protocol  (instance)


1.49.1 BLOX.BWidget class: popups

new
Create an instance of the receiver inside a BPopupWindow; do not map the window, answer the new widget. The created widget will become a child of the window and be completely attached to it (e.g. the geometry methods will modify the window's geometry). Note that while the widget *seems* to be directly painted on the root window, it actually belongs to the BPopupWindow; so don't send #destroy to the widget to remove it, but rather to the window.

popup: initializationBlock
Create an instance of the receiver inside a BPopupWindow; before returning, pass the widget to the supplied initializationBlock, then map the window. Answer the new widget. The created widget will become a child of the window and be completely attached to it (e.g. the geometry methods will modify the window's geometry). Note that while the widget *seems* to be directly painted on the root window, it actually belongs to the BPopupWindow; so don't send #destroy to the widget to remove it, but rather to the window.


1.49.2 BLOX.BWidget: accessing

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

Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the widget (if such a border is being drawn; the effect option typically determines this). The value may also be used when drawing 3-D effects in the interior of the widget. The value is measured in pixels.

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

Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the widget (if such a border is being drawn; the effect option typically determines this). The value may also be used when drawing 3-D effects in the interior of the widget. The value is measured in pixels.

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

Specifies the mouse cursor to be used for the widget. The value of the option is given by the standard X cursor cursor, i.e., any of the names defined in cursorcursor.h, without the leading XC_.

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

Specifies the mouse cursor to be used for the widget. The value of the option is given by the standard X cursor cursor, i.e., any of the names defined in cursorcursor.h, without the leading XC_.

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

Specifies the effect desired for the widget's border. Acceptable values are raised, sunken, flat, ridge, solid, and groove. The value indicates how the interior of the widget should appear relative to its exterior; for example, raised means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget. Raised and sunken give the traditional 3-D appearance (for example, that of Xaw3D), while ridge and groove give a "chiseled" appearance like that of Swing or GTK+'s Metal theme. Flat and solid are not 3-D.

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

Specifies the effect desired for the widget's border. Acceptable values are raised, sunken, flat, ridge, solid, and groove. The value indicates how the interior of the widget should appear relative to its exterior; for example, raised means the interior of the widget should appear to protrude from the screen, relative to the exterior of the widget. Raised and sunken give the traditional 3-D appearance (for example, that of Xaw3D), while ridge and groove give a "chiseled" appearance like that of Swing or GTK+'s Metal theme. Flat and solid are not 3-D.

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

Determines whether the window accepts the focus during keyboard traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, Blox consults the value of the tabStop option. A value of false means that the window should be skipped entirely during keyboard traversal. true means that the window should receive the input focus as long as it is viewable (it and all of its ancestors are mapped). If you do not set this option, Blox makes the decision about whether or not to focus on the window: the current algorithm is to skip the window if it is disabled, it has no key bindings, or if it is not viewable. Of the standard widgets, BForm, BContainer, BLabel and BImage have no key bindings by default.

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

Determines whether the window accepts the focus during keyboard traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, Blox consults the value of the tabStop option. A value of false means that the window should be skipped entirely during keyboard traversal. true means that the window should receive the input focus as long as it is viewable (it and all of its ancestors are mapped). If you do not set this option, Blox makes the decision about whether or not to focus on the window: the current algorithm is to skip the window if it is disabled, it has no key bindings, or if it is not viewable. Of the standard widgets, BForm, BContainer, BLabel and BImage have no key bindings by default.


1.49.3 BLOX.BWidget: 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 basicAddChild, to perform some initialization on the children just added. Answer the new child.

create
Make the receiver able to respond to its widget protocol. 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, to perform some initialization on the primitive widget just created; for an example of this, see the implementation of BButtonLike.

initialize: parentWidget
This is called by #new: to initialize the widget (as the name says...). The default implementation calls all the other methods in the `customization' protocol and some private ones that take care of making the receiver's status consistent, so you should usually call it instead of doing everything by hand. This method is public not because you can call it, but because it might be useful to override it. Always answer the receiver.

setInitialSize
This is called by #initialize: to set the widget's initial size. The whole area is occupied by default. This method is public not because you can call it, but because it can be useful to override it.


1.49.4 BLOX.BWidget: geometry management

boundingBox
Answer a Rectangle containing the bounding box of the receiver

boundingBox: rect
Set the bounding box of the receiver to rect (a Rectangle).

child: child height: value
Set the given child's height to value. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #height method. You should not use this method, which is automatically called by the child's #height: method, but you might want to override it. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just do nothing.

child: child heightOffset: value
Adjust the given child's height by a fixed amount of value pixel. This is meaningful for the default implementation, using `rubber-sheet' geometry management as explained in the comment to BWidget's #height and #heightOffset: methods. You should not use this method, which is automatically called by the child's #heightOffset: method, but you might want to override it. if it doesn't apply to the kind of geometry management that the receiver does, just add value to the current height of the widget.

child: child stretch: aBoolean
This method is only used when on the path from the receiver to its toplevel there is a BContainer. It decides whether child is among the widgets that are stretched to fill the entire width of the BContainer; if this has not been set for this widget, it is propagated along the widget hierarchy.

child: child width: value
Set the given child's width to value. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #width method. You should not use this method, which is automatically called by the child's #width: method, but you might want to override it. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just do nothing.

child: child widthOffset: value
Adjust the given child's width by a fixed amount of value pixel. This is meaningful for the default implementation, using `rubber-sheet' geometry management as explained in the comment to BWidget's #width and #widthOffset: methods. You should not use this method, which is automatically called by the child's #widthOffset: method, but you might want to override it. if it doesn't apply to the kind of geometry management that the receiver does, just add value to the current width of the widget.

child: child x: value
Set the given child's x to value. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #x method. You should not use this method, which is automatically called by the child's #x: method, but you might want to override it. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just do nothing.

child: child xOffset: value
Adjust the given child's x by a fixed amount of value pixel. This is meaningful for the default implementation, using `rubber-sheet' geometry management as explained in the comment to BWidget's #x and #xOffset: methods. You should not use this method, which is automatically called by the child's #xOffset: method, but you might want to override it. if it doesn't apply to the kind of geometry management that the receiver does, just add value to the current x of the widget.

child: child y: value
Set the given child's y to value. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #y method. You should not use this method, which is automatically called by the child's #y: method, but you might want to override it. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just do nothing.

child: child yOffset: value
Adjust the given child's y by a fixed amount of value pixel. This is meaningful for the default implementation, using `rubber-sheet' geometry management as explained in the comment to BWidget's #y and #yOffset: methods. You should not use this method, which is automatically called by the child's #yOffset: method, but you might want to override it. if it doesn't apply to the kind of geometry management that the receiver does, just add value to the current y of the widget.

extent
Answer a Point containing the receiver's size

extent: extent
Set the receiver's size to the width and height contained in extent (a Point).

height
Answer the `variable' part of the receiver's height within the parent widget. The value returned does not include any fixed amount of pixels indicated by #heightOffset: and must be interpreted in a relative fashion: the ratio of the returned value to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management. Behavior if the left or right edges are not within the client area of the parent is not defined -- the window might be clamped or might be positioned according to the specification.

height: value
Set to `value' the height of the widget within the parent widget. The value is specified in a relative fashion as an integer, so that the ratio of `value' to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management.

heightAbsolute
Force a recalculation of the layout of widgets in the receiver's parent, then answer the current height of the receiver in pixels.

heightChild: child
Answer the given child's height. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #height method. You should not use this method, which is automatically called by the child's #height method, but you might want to override. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just return 0.

heightOffset
Private - Answer the pixels to be added or subtracted to the height of the receiver, with respect to the value set in a relative fashion through the #height: method.

heightOffset: value
Add or subtract to the height of the receiver a fixed amount of `value' pixels, with respect to the value set in a relative fashion through the #height: method. Usage of this method is deprecated; use #inset: and BContainers instead.

heightPixels: value
Set the current height of the receiver to `value' pixels. Note that, after calling this method, #height will answer 0, which is logical considering that there is no `variable' part of the size (refer to #height and #height: for more explanations).

inset: pixels
Inset the receiver's bounding box by the specified amount.

left: left top: top right: right bottom: bottom
Set the bounding box of the receiver through its components.

pos: position
Set the receiver's origin to the width and height contained in position (a Point).

posHoriz: aBlox
Position the receiver immediately to the right of aBlox.

posVert: aBlox
Position the receiver just below aBlox.

stretch: aBoolean
This method is only considered when on the path from the receiver to its toplevel there is a BContainer. It decides whether we are among the widgets that are stretched to fill the entire width of the BContainer.

width
Answer the `variable' part of the receiver's width within the parent widget. The value returned does not include any fixed amount of pixels indicated by #widthOffset: and must be interpreted in a relative fashion: the ratio of the returned value to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management. Behavior if the left or right edges are not within the client area of the parent is not defined -- the window might be clamped or might be positioned according to the specification.

width: value
Set to `value' the width of the widget within the parent widget. The value is specified in a relative fashion as an integer, so that the ratio of `value' to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management.

width: xSize height: ySize
Set the size of the receiver through its components xSize and ySize.

widthAbsolute
Force a recalculation of the layout of widgets in the receiver's parent, then answer the current width of the receiver in pixels.

widthChild: child
Answer the given child's width. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #width method. You should not use this method, which is automatically called by the child's #width method, but you might want to override. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just return 0.

widthOffset
Private - Answer the pixels to be added or subtracted to the width of the receiver, with respect to the value set in a relative fashion through the #width: method.

widthOffset: value
Add or subtract to the width of the receiver a fixed amount of `value' pixels, with respect to the value set in a relative fashion through the #width: method. Usage of this method is deprecated; use #inset: and BContainers instead.

widthPixels: value
Set the current width of the receiver to `value' pixels. Note that, after calling this method, #width will answer 0, which is logical considering that there is no `variable' part of the size (refer to #width and #width: for more explanations).

x
Answer the `variable' part of the receiver's x within the parent widget. The value returned does not include any fixed amount of pixels indicated by #xOffset: and must be interpreted in a relative fashion: the ratio of the returned value to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management. Behavior if the left or right edges are not within the client area of the parent is not defined -- the window might be clamped or might be positioned according to the specification.

x: value
Set to `value' the x of the widget within the parent widget. The value is specified in a relative fashion as an integer, so that the ratio of `value' to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management.

x: xPos y: yPos
Set the origin of the receiver through its components xPos and yPos.

x: xPos y: yPos width: xSize height: ySize
Set the bounding box of the receiver through its origin and size.

xAbsolute
Force a recalculation of the layout of widgets in the receiver's parent, then answer the current x of the receiver in pixels.

xChild: child
Answer the given child's x. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #x method. You should not use this method, which is automatically called by the child's #x method, but you might want to override. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just return 0.

xOffset
Private - Answer the pixels to be added or subtracted to the x of the receiver, with respect to the value set in a relative fashion through the #x: method.

xOffset: value
Add or subtract to the x of the receiver a fixed amount of `value' pixels, with respect to the value set in a relative fashion through the #x: method. Usage of this method is deprecated; use #inset: and BContainers instead.

xPixels: value
Set the current x of the receiver to `value' pixels. Note that, after calling this method, #x will answer 0, which is logical considering that there is no `variable' part of the size (refer to #x and #x: for more explanations).

xRoot
Answer the x position of the receiver with respect to the top-left corner of the desktop (including the offset of the virtual root window under X).

y
Answer the `variable' part of the receiver's y within the parent widget. The value returned does not include any fixed amount of pixels indicated by #yOffset: and must be interpreted in a relative fashion: the ratio of the returned value to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management. Behavior if the left or right edges are not within the client area of the parent is not defined -- the window might be clamped or might be positioned according to the specification.

y: value
Set to `value' the y of the widget within the parent widget. The value is specified in a relative fashion as an integer, so that the ratio of `value' to the current size of the parent will be preserved upon resize. This apparently complicated method is known as `rubber sheet' geometry management.

yAbsolute
Force a recalculation of the layout of widgets in the receiver's parent, then answer the current y of the receiver in pixels.

yChild: child
Answer the given child's y. The default implementation of this method uses `rubber-sheet' geometry management as explained in the comment to BWidget's #y method. You should not use this method, which is automatically called by the child's #y method, but you might want to override. The child's property slots whose name ends with `Geom' are reserved for this method. This method should never fail -- if it doesn't apply to the kind of geometry management that the receiver does, just return 0.

yOffset
Private - Answer the pixels to be added or subtracted to the y of the receiver, with respect to the value set in a relative fashion through the #y: method.

yOffset: value
Add or subtract to the y of the receiver a fixed amount of `value' pixels, with respect to the value set in a relative fashion through the #y: method. Usage of this method is deprecated; use #inset: and BContainers instead.

yPixels: value
Set the current y of the receiver to `value' pixels. Note that, after calling this method, #y will answer 0, which is logical considering that there is no `variable' part of the size (refer to #y and #y: for more explanations).

yRoot
Answer the y position of the receiver with respect to the top-left corner of the desktop (including the offset of the virtual root window under X).


1.49.5 BLOX.BWidget: widget protocol

activate
At any given time, one window on each display is designated as the focus window; any key press or key release events for the display are sent to that window. This method allows one to choose which window will have the focus in the receiver's display

If the application currently has the input focus on the receiver's display, this method resets the input focus for the receiver's display to the receiver. If the application doesn't currently have the input focus on the receiver's display, Blox will remember the receiver as the focus for its top-level; the next time the focus arrives at the top-level, it will be redirected to the receiver (this is because most window managers will set the focus only to top-level windows, leaving it up to the application to redirect the focus among the children of the top-level).

activateNext
Activate the next widget in the focus `tabbing' order. The focus order depends on the widget creation order; you can set which widgets are in the order with the #tabStop: method.

activatePrevious
Activate the previous widget in the focus `tabbing' order. The focus order depends on the widget creation order; you can set which widgets are in the order with the #tabStop: method.

bringToTop
Raise the receiver so that it is above all of its siblings in the widgets' z-order; the receiver will not be obscured by any siblings and will obscure any siblings that overlap it.

isActive
Return whether the receiver is the window that currently owns the focus on its display.

sendToBack
Lower the receiver so that it is below all of its siblings in the widgets' z-order; the receiver will be obscured by any siblings that overlap it and will not obscure any siblings.



Back: BLOX.BWidget-geometry management Up: BLOX.BWidget Forward: BLOX.BWindow   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