head	1.4;
access;
symbols
	core-8-5-9:1.4
	core-8-5-8:1.4
	macosx-cocoa-merge:1.4
	macosx-cocoa-premerge:1.4
	macosx-carbon-freeze:1.4
	core-8-5-7:1.4
	core-8-5-6:1.4
	core-8-6-b1:1.4
	core-8-6-a3:1.4
	core-8-5-5:1.4
	core-8-6-a2:1.4
	core-8-5-4:1.4
	core-8-5-3:1.4
	core-8-6-a1:1.4
	core-8-5-branch:1.4.0.2
	core-8-5-2:1.4
	core-8-5-1:1.4
	core-8-5-0:1.4
	core-8-5-b3:1.3
	core-8-5-b2:1.3
	core-8-5-b1:1.2
	core-stablilizer-merge:1.2
	core-stabilizer-branch:1.2.0.2
	core-stabilizer-merge:1.4
	core-8-5-a6:1.2;
locks; strict;
comment	@# @;


1.4
date	2007.12.13.15.28.49;	author dgp;	state Exp;
branches;
next	1.3;

1.3
date	2007.10.09.12.34.34;	author patthoyts;	state Exp;
branches;
next	1.2;

1.2
date	2006.12.09.20.53.35;	author jenglish;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2006.10.31.01.42.27;	author hobbs;	state Exp;
branches;
next	;

1.2.2.1
date	2007.10.11.02.58.39;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.4
log
@merge stable branch onto HEAD
@
text
@#
# $Id: image.test,v 1.2.2.1 2007/10/11 02:58:39 dgp Exp $
#

package require Tk 8.5
package require tcltest ; namespace import -force tcltest::*
loadTestedCommands

test image-1.1 "Bad image element" -body {
    ttk::style element create BadImage image badimage
} -returnCodes error -result {image "badimage" doesn't exist}

test image-1.2 "Duplicate element" -setup {
    image create photo test.element -width 10 -height 10
    ttk::style element create testElement image test.element
} -body {
    ttk::style element create testElement image test.element
} -returnCodes 1 -result "Duplicate element testElement"

test image-2.0 "Deletion of displayed image (label)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::label .ttk_image20 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image20
} -result {}
    
test image-2.1 "Deletion of displayed image (checkbutton)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::checkbutton .ttk_image21 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image21
} -result {}

test image-2.2 "Deletion of displayed image (radiobutton)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::radiobutton .ttk_image22 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image22
} -result {}

#
tcltest::cleanupTests
@


1.3
log
@Make Ttk_GetImage safe if called with NULL interp. Added some tests
that crash on Windows without this fix.
@
text
@d2 1
a2 1
# $Id: image.test,v 1.2 2006/12/09 20:53:35 jenglish Exp $
@


1.2
log
@Merged duplicate functionality between image element factory,
image element, and -image option processing.  Image element
factory now takes an imageSpec argument instead of a separate
image name and -map option.
@
text
@d2 1
a2 1
# $Id: image.test,v 1.1 2006/10/31 01:42:27 hobbs Exp $
d20 33
@


1.2.2.1
log
@merge updates from HEAD
@
text
@d2 1
a2 1
# $Id: image.test,v 1.3 2007/10/09 12:34:34 patthoyts Exp $
a19 33
test image-2.0 "Deletion of displayed image (label)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::label .ttk_image20 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image20
} -result {}
    
test image-2.1 "Deletion of displayed image (checkbutton)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::checkbutton .ttk_image21 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image21
} -result {}

test image-2.2 "Deletion of displayed image (radiobutton)" -setup {
     image create photo test.image -width 10 -height 10
} -body {
    pack [set w [ttk::radiobutton .ttk_image22 -image test.image]]
    tkwait visibility $w
    image delete test.image
    update
} -cleanup {
    destroy .ttk_image22
} -result {}

@


1.1
log
@	* doc/ttk_Geometry.3, doc/ttk_Theme.3, doc/ttk_button.n:
	* doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
	* doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n:
	* doc/ttk_intro.n, doc/ttk_label.n, doc/ttk_labelframe.n:
	* doc/ttk_menubutton.n, doc/ttk_notebook.n, doc/ttk_panedwindow.n:
	* doc/ttk_progressbar.n, doc/ttk_radiobutton.n, doc/ttk_scrollbar.n:
	* doc/ttk_separator.n, doc/ttk_sizegrip.n, doc/ttk_style.n:
	* doc/ttk_treeview.n, doc/ttk_widget.n,:
	* generic/ttk/ttk.decls, generic/ttk/ttkBlink.c:
	* generic/ttk/ttkButton.c, generic/ttk/ttkCache.c:
	* generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
	* generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
	* generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
	* generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
	* generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
	* generic/ttk/ttkLayout.c, generic/ttk/ttkManager.c:
	* generic/ttk/ttkManager.h, generic/ttk/ttkNotebook.c:
	* generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c:
	* generic/ttk/ttkScale.c, generic/ttk/ttkScroll.c:
	* generic/ttk/ttkScrollbar.c, generic/ttk/ttkSeparator.c:
	* generic/ttk/ttkSquare.c, generic/ttk/ttkState.c:
	* generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
	* generic/ttk/ttkTagSet.c, generic/ttk/ttkTheme.c:
	* generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h:
	* generic/ttk/ttkTrace.c, generic/ttk/ttkTrack.c:
	* generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
	* generic/ttk/ttkWidget.h:
	* library/demos/ttk_demo.tcl, library/demos/ttk_iconlib.tcl:
	* library/demos/ttk_repeater.tcl:
	* library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl:
	* library/ttk/button.tcl, library/ttk/clamTheme.tcl:
	* library/ttk/classicTheme.tcl, library/ttk/combobox.tcl:
	* library/ttk/cursors.tcl, library/ttk/defaults.tcl:
	* library/ttk/dialog.tcl, library/ttk/entry.tcl:
	* library/ttk/fonts.tcl, library/ttk/icons.tcl:
	* library/ttk/keynav.tcl, library/ttk/menubutton.tcl:
	* library/ttk/notebook.tcl, library/ttk/panedwindow.tcl:
	* library/ttk/progress.tcl, library/ttk/scale.tcl:
	* library/ttk/scrollbar.tcl, library/ttk/sizegrip.tcl:
	* library/ttk/treeview.tcl, library/ttk/ttk.tcl:
	* library/ttk/utils.tcl, library/ttk/winTheme.tcl:
	* library/ttk/xpTheme.tcl:
	* macosx/ttkMacOSXTheme.c:
	* tests/ttk/all.tcl, tests/ttk/bwidget.test, tests/ttk/combobox.test:
	* tests/ttk/entry.test, tests/ttk/image.test:
	* tests/ttk/labelframe.test, tests/ttk/layout.test:
	* tests/ttk/misc.test, tests/ttk/notebook.test:
	* tests/ttk/panedwindow.test, tests/ttk/progressbar.test:
	* tests/ttk/scrollbar.test, tests/ttk/treetags.test:
	* tests/ttk/treeview.test, tests/ttk/ttk.test, tests/ttk/validate.test:
	* win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c:
	First import of Ttk themed Tk widgets as branched from tile 0.7.8

	* generic/tkInt.h, generic/tkWindow.c: add Ttk_Init call, copy
	tk classic widgets to ::tk namespace.
	* library/tk.tcl: add source of ttk/ttk.tcl, define $::ttk::library.
	* unix/Makefile.in, win/Makefile.in: add Ttk build bits
	* win/configure, win/configure.in: check for uxtheme.h (XP theme).
@
text
@d2 1
a2 1
# $Id: image.test,v 1.5 2005/04/10 02:12:29 jenglish Exp $
a8 18
# catch background errors:
#
if {[info procs bgerror] == "bgerror"} { rename bgerror {} }
array set BGerror { caught 0 message {} }
proc bgerror {message} {
    variable BGerror
    set BGerror(caught) 1
    set BGerror(message) $message
}
proc caughtbgerror {} {
    variable BGerror
    if {!$BGerror(caught)} {
        error "No bgerror caught"
    }
    set BGerror(caught) 0
    return $BGerror(message)
}

d11 1
a11 6
    ttk::style layout BadImage { BadImage }
    ttk::label .l -style BadImage
    pack .l ; update
    destroy .l
    caughtbgerror
} -result {image "badimage" doesn't exist}
@

