interaction models ii marti hearst (ucb sims) sims 213, ui design & development march 11, 1999

31
Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Upload: howard-domenic-eaton

Post on 03-Jan-2016

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Interaction Models II

Marti Hearst (UCB SIMS)SIMS 213, UI Design &

DevelopmentMarch 11, 1999

Page 2: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Today

Review concepts from last time For more information, see Olsen 98, Developing User

Interfaces

Go through examples with tcl/TK Discuss other interaction models

Page 3: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Event-based Interactions Direct Manipulation/GUI

– the user is in control, instead of the computer

– more complex set of interactions than with command line interfaces»the user can do any of a number of

different things nextclose windowbring window

into focus

open folder

adjust scroll bar

change size

Page 4: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Windowing Systems are … Software libraries to create GUIS consisting of

windows, and implement the interactive elements of those windows

Software to create a program that allows the user to control the size and placement of these windows– called the Window Manager– in Unix which WM used is flexible

» there are many window managers for X» Linux allows toggle between two different WMs

– in most commercial systems there is only one choice

» MS conflates OS with WS

Page 5: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Widgets

A widget is a window in a graphical user interface – that has a particular appearance and

behavior– this appearance and behavior is

standardized over time»buttons, menus, scrollbars, text windows»canvas: more free form -- supports

creation of new widgets and more flexible actions like drawing and animation

Page 6: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Root Windows In most systems the root window

encompasses the entire display– when you right-click on the desktop

background, you bring up a menu corresponding to the root window

It is also convenient to refer to the top-most window of an application as the root window– e.g., the main window of an editor, of

powerpoint, as opposed to menu buttons on these applications

Page 7: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Window System Support for Widgets

Window system software provides the following functionality:– A set of resources associated with

each widget class»color, label, language,

– Routines to create and destroy instances of the widget

– Facility to support callbacks to run when events occur to an instance of the widget

Page 8: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Role of Window ManagerWindow manager deals with the “outer frame” of the windowe.g,. title bar, close window widget, icon bar, etc.

Application deals with the widgets inside the outer frame.The boundary differs in different systems.

Contrast Exceed application with NT application both under NT WM(same title bar and close widget, different status bar and scrollbar)

Page 9: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Callbacks Callbacks are nice from the

programmer’s viewpoint– only have to specify what to do if the event

occurs on the widget– don’t have to say when and where– use an object-oriented model

Examples:– callback for button

» start running the search, answer yes or no

– callback for menu» run the function associated with the menu item, e.g.,

open new file, run slide show

Page 10: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

How the Window System Dispatches the Events

Windowing system is generating events

Object model wants method (callback) invocation

Event handler converts events directed to a window into method invocations

Page 11: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Application

Event Dispatching

Event Handler

WIDGET OBJECTS

button callback(invoked if mouse enter,

mouse press,mouse release on button)

window resize(invoked if mouse enter,

mouse press, mouse drag onresize widget )

scrollbar callback(invoked if mouse enter,

mouse press,mouse drag on scrollbar)

WindowSystemEventQueue

e

e0e1e2e3e4...eN

Page 12: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Running GUI Applications over the Network

X lets you run a GUI application on one machine and interact with it on another– you can’t do this in MS products

» I can’t run excel on my home machine and see and interact with it on my work machine

» I can do this sort of thing with X

Server MachineX displays the bits here

Client Machineeditor running here

Network

User can interact with the GUI here, even though it is running elsewhere

Page 13: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Examples using Tcl/TK

Code is written in the tcl scripting language There are classes of widgets

– button, listbox, checkbox, menu, etc Each widget takes attribute/value pairs

– text, label, color, command, borderwidth, etc Each widget has a name

– nesting is indicated with “.”– must start with a top-level window– the defaut root is called “.”

Frames are used to group widgets together

Page 14: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Create, display, and destroy a window containing a label

frame .flabel .f.l -text “this is a label” -border 4pack .fpack .f.ldestroy .f

The pack command tells the window manager where to place the various subwindows (widgets)

Page 15: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Create a row of buttons, each with a different kind of border relief

% frame .f -borderwidth 10% pack .f% foreach style {raised sunken flat ridge groove} { label .f.$style -text $style -relief $style -bd 4 pack .f.$style -side left -padx 4 }

This time we tell the pack command to pack the buttons to the lefthand side, one after the other, and to put 4 units of padding

around each one, in the horizontal (x) direction

Page 16: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Create a top-level window, make some frames, insert a label and an

entry form

% global result ; global rtext% set f [toplevel .prompt -bd 10]% label $f.msg -text “Please enter a name”% entry $f.entry -textvariable rtext% set b [frame $f.buttons -bd 10]% pack $f.msg $f.entry $f.buttons -side top -fill x

Page 17: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Add two buttons and do the layout(the commands attribute is the callback function)

% button $b.ok -text OK -command \ {set result 1} -underline 0% button $b.cancel -text Cancel -command \ {set result 0} -underline 0% pack $b.ok $b.cancel -side left

Page 18: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Place the mouse focus in the entry label. Force the user to attend to

the dialog box before doing anything else

% focus $f.entry% grab $f% tkwait variable result% grab release $f

Page 19: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Tell the system to print the name if the user enters one and presses Ok.

Otherwise don’t print anything.

% if {$result != 0} {puts $rtext

}

Page 20: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Add Keyboard Shortcuts...% pack $b.ok $b.cancel -side left

% bind .prompt <Control-o> "focus $b.ok ; break"% bind .prompt <Control-a> "focus $b.cancel ; break"% bind .prompt <Return> "set result 1"% bind .prompt <Control-c> "set result 0"

% focus $f.entry...

Page 21: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Using the Canvas% frame .c ; set c .c; pack .c% $c create oval 10 10 80 80 -fill red -width 4% $c create oval 170 10 250 40 -fill black -stipple gray25% $c create arc 30 30 100 100 -start 45 -extent 90 \ -style pieslice -fill green -outline black

Page 22: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Question

What is the relation to web browser interactions? – hyperlinks– forms– javascript pop-ups

Page 23: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Five Primary Interaction Styles

(Shneiderman 98) Direct manipulation Menu selection Form fillin Command language Natural language

– These are all in response to the baseline of command languages

– All types not appropriate for all tasks– Often useful to blend interactions styles in

one UI

Page 24: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Direct Manipulation

Advantagesvisually presents

task conceptslearnabilityretentionerror avoidanceencourages

explorationhigh subjective

satisfaction

Disadvantagescan be difficult to

program (especially error handling)

requires higher end equipment

non-sighted users

Visual representation of objects and tasks that can be manipulated in arbitrary orders by users

Page 25: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Menu Selection

Advantagesreduces learning

timereduces keystrokesstructures decision

makingeasy to support

error handling

Disadvantagestoo many menus for

complex taskscan be slow for

frequent usersconsumes screen

spacerequires rapid

display rate

Page 26: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Menus There are many variations

– pull-down– pop-up– command– cascading menus– iconic menus– tree-structured menus (site maps)

– pie menus (pop-up radial)

– multiple-column menus (common on WWW)

– Lots of studies have been done– how many items/to what depth– dynamically rearranging contents according to frequency– role of stable position within a pull-down menu– titling

Page 27: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Form Fillin

Advantagessimplifies data entryrequires modest

trainingconvenient

assistance (recognition vs. recall)

allows for form-management tools

Disadvantagesconsumes screen

space

Page 28: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Command Language

Advantagesflexibleappeals to “power”

usersallows user initiativeallows convenient

creation of macros

Disadvantagespoor error handlingrequires substantial

training and memorization

Page 29: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Natural Language

Advantagesnatural to specify

(no need to learn syntax)

less intimidating for novices

Disadvantagescan’t really be done

yetrequires clarification

dialogmay require more

keystrokes (unless spoken)

unpredictable results

Page 30: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Questions

What category does a toolbar or palette fall into?

What is the relationship between these interaction styles and widgets in a GUI system?

Page 31: Interaction Models II Marti Hearst (UCB SIMS) SIMS 213, UI Design & Development March 11, 1999

Summary Windowing systems

– software to manage and arrange windows» keeps track of current focus

– software to support handling of user-created events» complex GUIS are built up of hierarchically nested windows

Events– associated with various types of input devices and actions– are handled one by one from a queue

Other Interaction types– menu-driven, command language, natural language,

form-fillin– UIs should mix and match as appropriate for the tasks

being supported