OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [demos/] [samples/] [Balloon.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Tix Demostration Program
2
#
3
# This sample program is structured in such a way so that it can be
4
# executed from the Tix demo program "widget": it must have a
5
# procedure called "RunSample". It should also have the "if" statment
6
# at the end of this file so that it can be run as a standalone
7
# program using tixwish.
8
 
9
# This file demonstrates the use of the tixBalloon widget, which provides
10
# a interesting way to give help tips about elements in your user interface.
11
# Your can display the help message in a "balloon" and a status bar widget.
12
#
13
proc RunSample {w} {
14
 
15
    # Create the status bar widget
16
    #
17
    label $w.status -width 40 -relief sunken -bd 1
18
    pack $w.status -side bottom -fill y -padx 2 -pady 1
19
 
20
    # These are two a mysterious widgets that need some explanation
21
    #
22
    button $w.button1 -text " Something Unexpected " \
23
        -command "destroy $w"
24
    button $w.button2 -text " Something Else Unexpected " \
25
        -command "destroy $w.button2"
26
    pack $w.button1 $w.button2 -side top -expand yes
27
 
28
    # Create the balloon widget and associate it with the widgets that we want
29
    # to provide tips for:
30
    tixBalloon $w.b -statusbar $w.status
31
 
32
    $w.b bind $w.button1 -balloonmsg "Close window" \
33
        -statusmsg "Press this button to close this window"
34
    $w.b bind $w.button2 -balloonmsg "Self-destruct\nButton" \
35
        -statusmsg "Press this button and it will get rid of itself"
36
}
37
 
38
if {![info exists tix_demo_running]} {
39
    wm withdraw .
40
    set w .demo
41
    toplevel $w
42
    RunSample $w
43
        bind $w <Destroy> {if {"%W" == ".demo"} exit}
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.