Class StateManager
... is listening to the Hive.Inbox and reacts on simulation start, stop, shutdown and heart beat bounce.
Inheritance
System.Object
StateManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Akka.Hive
Assembly: Akka.Hive.dll
Syntax
public class StateManager : IStateManagerBase, IWithInbox, IWithHive
Constructors
StateManager()
Declaration
protected StateManager()
Properties
Base
Declaration
public static IStateManagerBase Base { get; }
Property Value
| Type | Description |
|---|---|
| IStateManagerBase |
Methods
AfterSimulationStarted()
This is Called after the Simulation started. Does nothing on default. You can overwrite this to
Declaration
public virtual void AfterSimulationStarted()
AfterSimulationStopped()
This is Called after the Simulation started. Does nothing on default. You can overwrite this to
Declaration
public virtual void AfterSimulationStopped()
Bounce()
This is Called after the Systems Heart bounced. Does nothing on default. You can overwrite this to
Declaration
public virtual void Bounce()
SimulationIsTerminating()
This is Called after the Simulation started. Does nothing on default. You can overwrite this to
Declaration
public virtual void SimulationIsTerminating()
Start()
Starts the Actor system after Initialisation has been done.
Declaration
public StateManager Start()
Returns
| Type | Description |
|---|---|
| StateManager |
WithHive(Hive)
Adds the reference to the basic system to the StateManager
Declaration
public IWithHive WithHive(Hive hive)
Parameters
| Type | Name | Description |
|---|---|---|
| Hive | hive |
Returns
| Type | Description |
|---|---|
| IWithHive |
WithInbox(Inbox)
Adds an Inbox to the configuration
Declaration
public IWithInbox WithInbox(Inbox inbox)
Parameters
| Type | Name | Description |
|---|---|---|
| Akka.Actor.Inbox | inbox | Mailbox that can be used to communicate with the stateManager |
Returns
| Type | Description |
|---|---|
| IWithInbox |


Collierville High School TSA (CHS TSA) was founded in 2014 and has inspired members to pursue the infinite possibilities in the realm of science, technology, engineering, and mathematics.
The Motto for the 2019-2020 Collierville High School TSA Chapter:
“Looking forward to the future, because we are it!”
Creed: Students are expected to participate in a variety of competitions, fundraisers, and informational sessions to continue the legacy of Collierville High School TSA to the best of their ability. Members are responsible for paying all fees and dues for conferences. Proper TSA attire must be worn by members at competitions, and the rules set in place by TSA, the advisors, and the school are to be followed at all times.
Collierville High School TSA encourages students to attend the regional and state conferences in events that interest them, whether it may be biotechnology or children’s stories. In addition, we motivate members to participate in events they may not be as educated about, for we strive to widen their horizons on the reach of STEM in modern society.


GitHub Task Manager Agent
Most Recent Payload
Event Stream
{{ 'Disable' if globalProperties.pendingQueue.enabled else 'Enable' }}
Agent
{% block maincontent %}
Content will be loaded into this div.
{% endblock %}


Using Angular
Tooling
Angular is using TypeScript instead of JavaScript, and as a result some specific tooling is necessary to work efficiently with it. Our development workflow for an Angular 2+ application is as below, use npm
instead of yarn
if you prefer that.
- When you generate an application the files are created and at the end of generation
npm install
task is triggered. - Once
npm install
is complete it calls thepostInstall
script inpackage.json
, this step triggers thewebpack:build
task. - Now you should have all files generated and compiled into the
www
folder inside thetarget
orbuild
folder based on the build tool (Maven or Gradle) selected. - Now run
./mvnw
or./gradlew
to launch the application server and it should be available at localhost:8080 this also serves the client side code compiled from the above steps. - Now run
npm start
oryarn start
in a new terminal to launch Webpack dev-server with BrowserSync. This will take care of compiling your TypeScript code, and automatically reloading your browser.
If you start making changes to the client side code without having npm start
or yarn start
running, nothing will be reflected as the changes are not compiled so you need to either run npm run webpack:build
manually after changes or have npm start
or yarn start
running.
You can also force Maven to run the webpack:dev
task while starting by passing the webpack
profile like ./mvnw -Pdev,webpack
.
Note Gradle automatically runs webpack compilation in dev
profile if front end has changed (only at start up, for live reload use npm start
or yarn start
).
Other available yarn/npm commands can be found in the scripts
section of your project’s package.json
file.
- To work on your code in your browser, we recommend using Angular Augury, so you can visualize your routes and debug your code
Project Structure
The JHipster client code can be found under src/main/webapp
, and follows closely the John Papa Angular 2 style guide. Please read this guide first if you have any question on our application structure, file names, TypeScript conventions…
This style guide is endorsed by the Angular team, and provides best practices that every Angular project should follow.
For Angular routes we follow a dash cased naming convention so that the URLs are clean and consistent. When you generate an entity the route names, route URLs and REST API endpoint URLs are generated according to this convention, also entity names are automatically pluralized where required.
Here is the main project structure:
webapp
├── app - Your application
│ ├── account - User account management UI
│ ├── admin - Administration UI
│ ├── blocks - Common building blocks like configuration and interceptors
│ ├── entities - Generated entities (more information below)
│ ├── home - Home page
│ ├── layouts - Common page layouts like navigation bar and error pages
│ ├── shared - Common services like authentication and internationalization
│ ├── app.main.ts - Main application class
│ ├── app.module.ts - Application modules configuration
│ ├── app-routing.module.ts - Main application router
├── content - Static content
│ ├── css - CSS stylesheets
│ ├── images - Images
├── i18n - Translation files
├── scss - Sass style sheet files will be here if you choose the option
├── swagger-ui - Swagger UI front-end
├── 404.html - 404 page
├── favicon.ico - Fav icon
├── index.html - Index page
├── robots.txt - Configuration for bots and Web crawlers
Using the entity sub-generator to create a new entity called Foo
generates the following front-end files under src/main/webapp
:
webapp
├── app
│ ├── entities
│ ├── foo - CRUD front-end for the Foo entity
│ ├── foo.component.html - HTML view for the list page
│ ├── foo.component.ts - Controller for the list page
│ ├── foo.model.ts - Model representing the Foo entity
│ ├── foo.module.ts - Angular module for the Foo entity
│ ├── foo.route.ts - Angular Router configuration
│ ├── foo.service.ts - Service which access the Foo REST resource
│ ├── foo-delete-dialog.component.html - HTML view for deleting a Foo
│ ├── foo-delete-dialog.component.ts - Controller for deleting a Foo
│ ├── foo-detail.component.html - HTML view for displaying a Foo
│ ├── foo-detail.component.ts - Controller or displaying a Foo
│ ├── foo-dialog.component.html - HTML view for editing a Foo
│ ├── foo-dialog.component.ts - Controller for editing a Foo
│ ├── foo-popup.service.ts - Service for handling the create/update dialog pop-up
│ ├── index.ts - Barrel for exporting everything
├── i18n - Translation files
│ ├── en - English translations
│ │ ├── foo.json - English translation of Foo name, fields, ...
│ ├── fr - French translations
│ │ ├── foo.json - French translation of Foo name, fields, ...
Please note that the default language translations would be based on what you have choosen during app generation. ‘en’ and ‘fr’ are shown here only for demonstration.
Authorizations
JHipster uses the Angular router to organize the different parts of your client application.
For each state, the required authorities are listed in the state’s data, and when the authority list is empty it means that the state can be accessed anonymously.
The authorities are also defined on the server-side in the class AuthoritiesConstants.java
, and logically the client and server-side authorities should be the same.
In the example below, the ‘sessions’ state is designed to be accessed only by authenticated users who have ROLE_USER
authority:
export const sessionsRoute: Route = {
path: 'sessions',
component: SessionsComponent,
data: {
authorities: ['ROLE_USER'],
pageTitle: 'global.menu.account.sessions'
},
canActivate: [UserRouteAccessService]
};
Once those authorities are defined in the router, they can be used through jhiHasAnyAuthority
directive within its 2 variants based on type of argument:
- for a single string, the directive only displays the HTML component if the user has the required authority
- for an array of strings, the directive displays the HTML component if the user has one of the listed authorities
For example, the following text will only be displayed to users having the ROLE_ADMIN
authority:

Hello, admin user

For example, the following text will only be displayed to users having one of the ROLE_ADMIN
or ROLE_USER
authorities:

Hello, dear user

Please note that those directives only show or hide HTML components on the client-side, and that you also need to secure your code on the server-side!
The ng-jhipster library
The ng-jhipster library is free and OSS, and available on https://github.com/jhipster/ng-jhipster.
The ng-jhipster library contains utility functions and common components that are used by Angular 2+ applications. They include:
- Validation directives
- Internationalization components
- Commonly-used pipes like capitalization, ordering and word truncation
- Base64, date and pagination handling services
- A notification system (see below)
Notification System
JHipster uses a custom notification system to send events from the server-side to the client-side, and has i18n-capable JhiAlertComponent
and JhiAlertErrorComponent
components which can be used throughout the generated applications.
By default JHipster will show error notifications when there is an error caught from an HTTP response.
To show a custom notification or alert, use the below methods after injecting the AlertService
to your controller, directive or service.
The shorthand methods success
, info
, warning
and error
will have a default timeout of 5 seconds, which can be configured:
this.alerts.push(
this.alertService.addAlert(
{
type: 'danger',
msg: 'you should not have pressed this button!',
timeout: 5000,
toast: false,
scoped: true
},
this.alerts
)
);
Using Angular CLI
Overview
Angular CLI is a tool to develop, scaffold and maintain Angular applications. JHipster generates the Angular CLI configuration file, so the Angular CLI workflows work with JHipster.
This integration is done by generating a angular.json
file in the application root folder and adding its dependencies in the package.json
file.
Usage
ng help
Building
You should not use ng build
to build your front-end, as JHipster has its own scripts. Check our “using in development” documentation and our “using in production” documentation.
Generating Components, Directives, Pipes and Services
You can use the ng generate
(or ng g
) command to generate Angular components:
ng generate component my-new-component
ng g component my-new-component # using the alias
# Components support relative path generation
# Go to src/app/feature/ and run
ng g component new-cmp
# your component will be generated in src/app/feature/new-cmp
# but if you were to run
ng g component ../newer-cmp
# your component will be generated in src/app/newer-cmp
You can find all possible blueprints in the table below:
| Scaffold | Usage |
|---|---|
| Component | ng g component my-new-component |
| Directive | ng g directive my-new-directive |
| Pipe | ng g pipe my-new-pipe |
| Service | ng g service my-new-service |
| Class | ng g class my-new-class |
| Guard | ng g guard my-new-guard |
| Interface | ng g interface my-new-interface |
| Enum | ng g enum my-new-enum |
| Module | ng g module my-module |
Test
For consistency purpose on JHipster application, tests are available through the npm
command:
npm test
i18n
JHipster is using the ng2-translate
dependency for translation purpose. Angular CLI i18n is based on the default Angular i18n support, which is incompatible with JHipster.
Running the server
If you prefer to use Angular CLI to develop you application, you can run your server directly by using its dedicated command.
ng serve
By using it, it will compile your Angular application and allow you to access it on http://localhost:4200
. However your backend will not be available from it by default.
To use your local backend server, use:
ng serve --proxy-conf proxy.conf.json
You will then be able to access your API.
Conclusion
For more information about the Angular CLI, please visit the official website https://cli.angular.io/


What learnings did you take from the chapter?
"Happiness is a skill that can be trained", and that happiness can be tied to an exceptionally healthy mind, or an optimal state of being - and an unavoidable side effect of emotional intelligence.
I also found it interesting that of the top six competencies that separate star performers from average performers in the tech sector, only two were based on intellectual abilities. Even more surprising, the top two were influenced on emotional intelligence.
Watching the short video, I also found Chade-Meng Tan's talk on the mindset shift when exercising mindfulness, from existential to experiential as your perception into the process of emotion sharpens. Once you become more aware of your emotions, you begin to view your emotions in a Big Sky Mindset - which is being able to identify when you are experiencing certain emotions instead of going "I'm angry" or "I'm sad" to "I'm experiencing anger" or "I'm experiencing sadness".


Encoding Xml Unmarshal
Most examples using Unmarshal show structs that are setup ahead of time to capture specific contents of the XML document. While this is the common use case, a struct can be designed to capture the document in a generic fashion, i.e., a struct that works for any XML document.
There are some limitations since this technique relies on XML struct tags to control the unmarshaling. The set of tags available do not include processing instructions or directives. There are also little quirks:
- The lexical position and number of comments may change. This is because all comments for an element are collected into a single one to save into the struct.
- There are no options to control whitespace.
Thus unless the input XML document is a single line,
a lot of entities for whitespace will be saved.
In the sample code I present below, I avoid this by using
strings.TrimSpace()
.
The key for a generic struct is to use some of the built-in types and to use slices to reflect one-to-many situations. Here is the struct:
// note that this struct does not include either
// ProcInst or Directive since tags are not
// provided for them (probably for reasonable cause)
type xmlany struct {
XMLName xml.Name
Attrs []xml.Attr `xml:",any,attr"`
Content string `xml:",chardata"`
Comment string `xml:",comment"`
Nested []*xmlany `xml:",any"`
}
The “Nested” slice will contain pointers to all child elements of the parent.
As with parseAny.go this example code isn’t so useful in its own right, but mostly serves to illustrate the technique so you can use it for your own use cases.
This example is here.


| |
ActiveTcl User Guide
|
|
|
- NAME
- listbox - Create and manipulate listbox widgets
- SYNOPSIS
- listbox pathName ?options?
- STANDARD OPTIONS
- -activestyle
- -background or -bg,
background, Background
- -borderwidth or -bd,
borderWidth, BorderWidth
- -cursor, cursor, Cursor
- -disabledforeground,
disabledForeground, DisabledForeground
- -exportselection,
exportSelection, ExportSelection
- -font, font, Font
- -foreground or -fg,
foreground, Foreground
- -height
- -highlightbackground,
highlightBackground, HighlightBackground
- -highlightcolor,
highlightColor, HighlightColor
- -highlightthickness,
highlightThickness, HighlightThickness
- -relief, relief, Relief
- -selectbackground,
selectBackground, Foreground
- -selectborderwidth,
selectBorderWidth, BorderWidth
- -selectforeground,
selectForeground, Background
- -setgrid, setGrid,
SetGrid
- -state
- -takefocus, takeFocus,
TakeFocus
- -width
- -xscrollcommand,
xScrollCommand, ScrollCommand
- -yscrollcommand,
yScrollCommand, ScrollCommand
- WIDGET-SPECIFIC
OPTIONS
- -activestyle,
activeStyle, ActiveStyle
- -height, height,
Height
- -listvariable,
listVariable, Variable
- -selectmode, selectMode,
SelectMode
- -state, state,
State
- -width, width,
Width
- DESCRIPTION
- INDICES
- number
- active
- anchor
- end
- @x,y
- WIDGET COMMAND
- pathName
activate index
- pathName
bbox index
- pathName
cget option
- pathName
configure ?option? ?value option value
...?
- pathName
curselection
- pathName
delete first ?last?
- pathName
get first ?last?
- pathName
index index
- pathName
insert index ?element element ...?
- pathName
itemcget index option
- pathName
itemconfigure index ?option? ?value?
?option value ...?
- -background
color
- -foreground
color
- -selectbackground
color
- -selectforeground
color
- pathName
nearest y
- pathName
scan option args
- pathName scan
mark x y
- pathName scan
dragto x y.
- pathName
see index
- pathName
selection option arg
- pathName
selection anchor index
- pathName
selection clear first ?last?
- pathName
selection includes index
- pathName
selection set first ?last?
- pathName
size
- pathName
xview args
- pathName
xview
- pathName
xview index
- pathName xview
moveto fraction
- pathName xview
scroll number what
- pathName
yview ?args?
- pathName
yview
- pathName
yview index
- pathName yview
moveto fraction
- pathName yview
scroll number what
- DEFAULT BINDINGS
- KEYWORDS
listbox - Create and manipulate listbox widgets
listbox pathName ?options?
- -activestyle
- -background or -bg,
background, Background
- -borderwidth or -bd,
borderWidth, BorderWidth
- -cursor, cursor,
Cursor
- -disabledforeground,
disabledForeground, DisabledForeground
- -exportselection,
exportSelection, ExportSelection
- -font, font, Font
- -foreground or -fg,
foreground, Foreground
- -height
- -highlightbackground,
highlightBackground, HighlightBackground
- -highlightcolor,
highlightColor, HighlightColor
- -highlightthickness,
highlightThickness, HighlightThickness
- -relief, relief,
Relief
- -selectbackground,
selectBackground, Foreground
- -selectborderwidth,
selectBorderWidth, BorderWidth
- -selectforeground,
selectForeground, Background
- -setgrid, setGrid,
SetGrid
- -state
- -takefocus, takeFocus,
TakeFocus
- -width
- -xscrollcommand,
xScrollCommand, ScrollCommand
- -yscrollcommand,
yScrollCommand, ScrollCommand
- Command-Line Name: -activestyle
- Database Name: activeStyle
- Database Class: ActiveStyle
- Specifies the style in which to draw the active element. This
must be one of dotbox (show a focus ring around the active
element), none (nospecial indication of active element) or
underline (underline the active element). The default is
underline.
- Command-Line Name: -height
- Database Name: height
- Database Class: Height
- Specifies the desired height for the window, in lines. If zero
or less, then the desired height for the window is made just large
enough to hold all the elements in the listbox.
- Command-Line Name: -listvariable
- Database Name: listVariable
- Database Class: Variable
- Specifies the name of a variable. The value of the variable is
a list to be displayed inside the widget; if the variable value
changes then the widget will automatically update itself to reflect
the new value. Attempts to assign a variable with an invalid list
value to -listvariable will cause an error. Attempts to
unset a variable in use as a -listvariable will fail but
will not generate an error.
- Command-Line Name: -selectmode
- Database Name: selectMode
- Database Class: SelectMode
- Specifies one of several styles for manipulating the selection.
The value of the option may be arbitrary, but the default bindings
expect it to be either single, browse,
multiple, or extended; the default value is
browse.
- Command-Line Name: -state
- Database Name: state
- Database Class: State
- Specifies one of two states for the listbox: normal or
disabled. If the listbox is disabled then items may not be
inserted or deleted, items are drawn in the
-disabledforeground color, and selection cannot be modified
and is not shown (though selection information is retained).
- Command-Line Name: -width
- Database Name: width
- Database Class: Width
- Specifies the desired width for the window in characters. If
the font doesn't have a uniform width then the width of the
character ``0'' is used in translating from character units to
screen units. If zero or less, then the desired width for the
window is made just large enough to hold all the elements in the
listbox.
The listbox command creates a new window (given by the
pathName argument) and makes it into a listbox widget.
Additional options, described above, may be specified on the
command line or in the option database to configure aspects of the
listbox such as its colors, font, text, and relief. The
listbox command returns its pathName argument. At the
time this command is invoked, there must not exist a window named
pathName, but pathName's parent must exist.
A listbox is a widget that displays a list of strings, one per
line. When first created, a new listbox has no elements. Elements
may be added or deleted using widget commands described below. In
addition, one or more elements may be selected as described below.
If a listbox is exporting its selection (see exportSelection
option), then it will observe the standard X11 protocols for
handling the selection. Listbox selections are available as type
STRING; the value of the
selection will be the text of the selected elements, with newlines
separating the elements.
It is not necessary for all the elements to be displayed in the
listbox window at once; commands described below may be used to
change the view in the window. Listboxes allow scrolling in both
directions using the standard xScrollCommand and
yScrollCommand options. They also support scanning, as
described below.
Many of the widget commands for listboxes take one or more
indices as arguments. An index specifies a particular element of
the listbox, in any of the following ways:
- number
- Specifies the element as a numerical index, where 0 corresponds
to the first element in the listbox.
- active
- Indicates the element that has the location cursor. This
element will be displayed as specified by -activestyle when
the listbox has the keyboard focus, and it is specified with the
activate widget command.
- anchor
- Indicates the anchor point for the selection, which is set with
the selection anchor
widget command.
- end
- Indicates the end of the listbox. For most commands this refers
to the last element in the listbox, but for a few commands such as
index and insert it refers to the element just after
the last one.
- @x,y
- Indicates the element that covers the point in the listbox
window specified by x and y (in pixel coordinates).
If no element covers that point, then the closest element to that
point is used.
In the widget command descriptions below, arguments named
index, first, and last always contain text
indices in one of the above forms.
The listbox command creates a new Tcl command whose name
is pathName. This command may be used to invoke various
operations on the widget. It has the following general form:
pathName option ?arg arg ...?
Option and the args determine the exact behavior
of the command. The following commands are possible for listbox
widgets:
- pathName activate
index
- Sets the active element to the one indicated by index.
If index is outside the range of elements in the listbox
then the closest element is activated. The active element is drawn
as specified by -activestyle when the widget has the input
focus, and its index may be retrieved with the index
active.
- pathName bbox index
- Returns a list of four numbers describing the bounding box of
the text in the element given by index. The first two
elements of the list give the x and y coordinates of the upper-left
corner of the screen area covered by the text (specified in pixels
relative to the widget) and the last two elements give the width
and height of the area, in pixels. If no part of the element given
by index is visible on the screen, or if index refers
to a non-existent element, then the result is an empty string; if
the element is partially visible, the result gives the full area of
the element, including any parts that are not visible.
- pathName cget
option
- Returns the current value of the configuration option given by
option. Option may have any of the values accepted by
the listbox command.
- pathName configure ?option?
?value option value ...?
- Query or modify the configuration options of the widget. If no
option is specified, returns a list describing all of the
available options for pathName (see Tk_ConfigureInfo for information
on the format of this list). If option is specified with no
value, then the command returns a list describing the one
named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If
one or more option-value pairs are specified, then the
command modifies the given widget option(s) to have the given
value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the
listbox command.
- pathName curselection
- Returns a list containing the numerical indices of all of the
elements in the listbox that are currently selected. If there are
no elements selected in the listbox then an empty string is
returned.
- pathName delete first
?last?
- Deletes one or more elements of the listbox. First and
last are indices specifying the first and last elements in
the range to delete. If last isn't specified it defaults to
first, i.e. a single element is deleted.
- pathName get first
?last?
- If last is omitted, returns the contents of the listbox
element indicated by first, or an empty string if
first refers to a non-existent element. If last is
specified, the command returns a list whose elements are all of the
listbox elements between first and last, inclusive.
Both first and last may have any of the standard
forms for indices.
- pathName index
index
- Returns the integer index value that corresponds to
index. If index is end the return value is a
count of the number of elements in the listbox (not the index of
the last element).
- pathName insert index
?element element ...?
- Inserts zero or more new elements in the list just before the
element given by index. If index is specified as
end then the new elements are added to the end of the list.
Returns an empty string.
- pathName itemcget index
option
- Returns the current value of the item configuration option
given by option. Option may have any of the values
accepted by the listbox itemconfigure command.
- pathName itemconfigure index
?option? ?value? ?option value ...?
- Query or modify the configuration options of an item in the
listbox. If no option is specified, returns a list
describing all of the available options for the item (see Tk_ConfigureInfo for
information on the format of this list). If option is
specified with no value, then the command returns a list
describing the one named option (this list will be identical to the
corresponding sublist of the value returned if no option is
specified). If one or more option-value pairs are specified,
then the command modifies the given widget option(s) to have the
given value(s); in this case the command returns an empty string.
The following options are currently supported for items:
- -background color
- Color specifies the background color to use when
displaying the item. It may have any of the forms accepted by Tk_GetColor.
- -foreground color
- Color specifies the foreground color to use when
displaying the item. It may have any of the forms accepted by Tk_GetColor.
- -selectbackground color
- color specifies the background color to use when
displaying the item while it is selected. It may have any of the
forms accepted by Tk_GetColor.
- -selectforeground color
- color specifies the foreground color to use when
displaying the item while it is selected. It may have any of the
forms accepted by Tk_GetColor.
- pathName nearest y
- Given a y-coordinate within the listbox window, this command
returns the index of the (visible) listbox element nearest to that
y-coordinate.
- pathName scan option
args
- This command is used to implement scanning on listboxes. It has
two forms, depending on option:
- pathName scan mark x
y
- Records x and y and the current view in the
listbox window; used in conjunction with later scan dragto
commands. Typically this command is associated with a mouse button
press in the widget. It returns an empty string.
- pathName scan dragto x
y.
- This command computes the difference between its x and
y arguments and the x and y arguments to the
last scan mark command for the widget. It then adjusts the
view by 10 times the difference in coordinates. This command is
typically associated with mouse motion events in the widget, to
produce the effect of dragging the list at high speed through the
window. The return value is an empty string.
- pathName see index
- Adjust the view in the listbox so that the element given by
index is visible. If the element is already visible then the
command has no effect; if the element is near one edge of the
window then the listbox scrolls to bring the element into view at
the edge; otherwise the listbox scrolls to center the element.
- pathName selection option
arg
- This command is used to adjust the selection within a listbox.
It has several forms, depending on option:
- pathName selection anchor
index
- Sets the selection anchor to the element given by index.
If index refers to a non-existent element, then the closest
element is used. The selection anchor is the end of the selection
that is fixed while dragging out a selection with the mouse. The
index anchor may be used to refer to the anchor
element.
- pathName selection clear
first ?last?
- If any of the elements between first and last
(inclusive) are selected, they are deselected. The selection state
is not changed for elements outside this range.
- pathName selection includes
index
- Returns 1 if the element indicated by index is currently
selected, 0 if it isn't.
- pathName selection set first
?last?
- Selects all of the elements in the range between first
and last, inclusive, without affecting the selection state
of elements outside that range.
- pathName size
- Returns a decimal string indicating the total number of
elements in the listbox.
- pathName xview args
- This command is used to query and change the horizontal
position of the information in the widget's window. It can take any
of the following forms:
- pathName xview
- Returns a list containing two elements. Each element is a real
fraction between 0 and 1; together they describe the horizontal
span that is visible in the window. For example, if the first
element is .2 and the second element is .6, 20% of the listbox's
text is off-screen to the left, the middle 40% is visible in the
window, and 40% of the text is off-screen to the right. These are
the same values passed to scrollbars via the -xscrollcommand
option.
- pathName xview
index
- Adjusts the view in the window so that the character position
given by index is displayed at the left edge of the window.
Character positions are defined by the width of the character
0.
- pathName xview moveto
fraction
- Adjusts the view in the window so that fraction of the
total width of the listbox text is off-screen to the left.
fraction must be a fraction between 0 and 1.
- pathName xview scroll number
what
- This command shifts the view in the window left or right
according to number and what. Number must be
an integer. What must be either units or pages
or an abbreviation of one of these. If what is units,
the view adjusts left or right by number character units
(the width of the 0 character) on the display; if it is
pages then the view adjusts by number screenfuls. If
number is negative then characters farther to the left
become visible; if it is positive then characters farther to the
right become visible.
- pathName yview
?args?
- This command is used to query and change the vertical position
of the text in the widget's window. It can take any of the
following forms:
- pathName yview
- Returns a list containing two elements, both of which are real
fractions between 0 and 1. The first element gives the position of
the listbox element at the top of the window, relative to the
listbox as a whole (0.5 means it is halfway through the listbox,
for example). The second element gives the position of the listbox
element just after the last one in the window, relative to the
listbox as a whole. These are the same values passed to scrollbars
via the -yscrollcommand option.
- pathName yview
index
- Adjusts the view in the window so that the element given by
index is displayed at the top of the window.
- pathName yview moveto
fraction
- Adjusts the view in the window so that the element given by
fraction appears at the top of the window. Fraction
is a fraction between 0 and 1; 0 indicates the first element in the
listbox, 0.33 indicates the element one-third the way through the
listbox, and so on.
- pathName yview scroll number
what
- This command adjusts the view in the window up or down
according to number and what. Number must be
an integer. What must be either units or
pages. If what is units, the view adjusts up
or down by number lines; if it is pages then the view
adjusts by number screenfuls. If number is negative
then earlier elements become visible; if it is positive then later
elements become visible.
Tk automatically creates class bindings for listboxes that give
them Motif-like behavior. Much of the behavior of a listbox is
determined by its selectMode option, which selects one of
four ways of dealing with the selection.
If the selection mode is single or browse, at most
one element can be selected in the listbox at once. In both modes,
clicking button 1 on an element selects it and deselects any other
selected item. In browse mode it is also possible to drag
the selection with button 1.
If the selection mode is multiple or extended, any
number of elements may be selected at once, including discontiguous
ranges. In multiple mode, clicking button 1 on an element
toggles its selection state without affecting any other elements.
In extended mode, pressing button 1 on an element selects
it, deselects everything else, and sets the anchor to the element
under the mouse; dragging the mouse with button 1 down extends the
selection to include all the elements between the anchor and the
element under the mouse, inclusive.
Most people will probably want to use browse mode for
single selections and extended mode for multiple selections;
the other modes appear to be useful only in special situations.
Any time the selection changes in the listbox, the virtual event
<<ListboxSelect>> will be generated. It is
easiest to bind to this event to be made aware of any changes to
listbox selection.
In addition to the above behavior, the following additional
behavior is defined by the default bindings:
- [1]
- In extended mode, the selected range can be adjusted by
pressing button 1 with the Shift key down: this modifies the
selection to consist of the elements between the anchor and the
element under the mouse, inclusive. The un-anchored end of this new
selection can also be dragged with the button down.
- [2]
- In extended mode, pressing button 1 with the Control key
down starts a toggle operation: the anchor is set to the element
under the mouse, and its selection state is reversed. The selection
state of other elements isn't changed. If the mouse is dragged with
button 1 down, then the selection state of all elements between the
anchor and the element under the mouse is set to match that of the
anchor element; the selection state of all other elements remains
what it was before the toggle operation began.
- [3]
- If the mouse leaves the listbox window with button 1 down, the
window scrolls away from the mouse, making information visible that
used to be off-screen on the side of the mouse. The scrolling
continues until the mouse re-enters the window, the button is
released, or the end of the listbox is reached.
- [4]
- Mouse button 2 may be used for scanning. If it is pressed and
dragged over the listbox, the contents of the listbox drag at high
speed in the direction the mouse moves.
- [5]
- If the Up or Down key is pressed, the location cursor (active
element) moves up or down one element. If the selection mode is
browse or extended then the new active element is
also selected and all other elements are deselected. In
extended mode the new active element becomes the selection
anchor.
- [6]
- In extended mode, Shift-Up and Shift-Down move the
location cursor (active element) up or down one element and also
extend the selection to that element in a fashion similar to
dragging with mouse button 1.
- [7]
- The Left and Right keys scroll the listbox view left and right
by the width of the character 0. Control-Left and
Control-Right scroll the listbox view left and right by the width
of the window. Control-Prior and Control-Next also scroll left and
right by the width of the window.
- [8]
- The Prior and Next keys scroll the listbox view up and down by
one page (the height of the window).
- [9]
- The Home and End keys scroll the listbox horizontally to the
left and right edges, respectively.
- [10]
- Control-Home sets the location cursor to the the first element
in the listbox, selects that element, and deselects everything else
in the listbox.
- [11]
- Control-End sets the location cursor to the the last element in
the listbox, selects that element, and deselects everything else in
the listbox.
- [12]
- In extended mode, Control-Shift-Home extends the
selection to the first element in the listbox and Control-Shift-End
extends the selection to the last element.
- [13]
- In multiple mode, Control-Shift-Home moves the location
cursor to the first element in the listbox and Control-Shift-End
moves the location cursor to the last element.
- [14]
- The space and Select keys make a selection at the location
cursor (active element) just as if mouse button 1 had been pressed
over this element.
- [15]
- In extended mode, Control-Shift-space and Shift-Select
extend the selection to the active element just as if button 1 had
been pressed with the Shift key down.
- [16]
- In extended mode, the Escape key cancels the most recent
selection and restores all the elements in the selected range to
their previous selection state.
- [17]
- Control-slash selects everything in the widget, except in
single and browse modes, in which case it selects the
active element and deselects everything else.
- [18]
- Control-backslash deselects everything in the widget, except in
browse mode where it has no effect.
- [19]
- The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is a
selection.
The behavior of listboxes can be changed by defining new
bindings for individual widgets or by redefining the class
bindings.
listbox, widget
Copyright © 1990 The Regents of the University of California.
Copyright © 1994-1997 Sun Microsystems, Inc.
Copyright © 1995-1997 Roger E. Critchlow Jr.


WITNESS LIST Agriculture & Livestock Committee March 9, 2000-10:00A Committee Oversight On: Allen, Ron (Texas State Board of Veterinary Medical Examiners) Avant, Bob (Texas Food & Fibers Commission) Bauma, Brad (Texas Animal Health Commission) Beals, Terry (Texas Animal Health Commission) Beverly, John (Texas Agricultural Experiment Station) Buckley, Robert (Texas State Soil and Water Conservation Board) Combs, Susan (Texsa Department of Agriculture) Eugster, Konrad (Texas Veterinary Medical Diagnostic Laboratory) Fehlis, Chester (Texas Agricultural Extension Service) Hiler, Edward (Texas A&M University) Hull, Jim (Texas Forest Service) Mathis, Benny (Structural Pest Control Board) Nunley, Gary Lee (Texas Wildlife Damage Management Service)