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

Subversion Repositories or1k_old

[/] [or1k_old/] [tags/] [start/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [menubar] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/sh
2
# ----------------------------------------------------------------------
3
#  DEMO: menubar in [incr Widgets]
4
# ----------------------------------------------------------------------
5
#\
6
exec itkwish "$0" ${1+"$@"}
7
package require Iwidgets 3.0
8
 
9
iwidgets::menubar .mb -helpvariable helpVar -menubuttons {
10
    menubutton file -text "File" -menu {
11
        options -tearoff false
12
 
13
        command new -label "New" \
14
                -helpstr "Open new document" \
15
                -command {puts "selected: New"}
16
 
17
        command close -label "Close" \
18
                -helpstr "Close current document" \
19
                -command {puts "selected: Close"}
20
 
21
        separator sep1
22
 
23
        command exit -label "Exit" -command {exit} \
24
                -helpstr "Exit application"
25
    }
26
 
27
    menubutton edit -text "Edit" -menu {
28
        options -tearoff false
29
 
30
        command undo -label "Undo" -underline 0 \
31
                -helpstr "Undo last command" \
32
                -command {puts "selected: Undo"}
33
 
34
        separator sep2
35
 
36
        command cut -label "Cut" -underline 1 \
37
                -helpstr "Cut selection to clipboard" \
38
                -command {puts CUT}
39
 
40
        command copy -label "Copy" -underline 1 \
41
                -helpstr "Copy selection to clipboard" \
42
                -command {puts "selected: Copy"}
43
 
44
        command paste -label "Paste" -underline 0 \
45
                -helpstr "Paste clipboard contents into document" \
46
                -command {puts "selected: Paste"}
47
    }
48
 
49
    menubutton options -text "Options" -menu {
50
        options -tearoff false -selectcolor blue
51
 
52
        radiobutton byName -variable viewMode \
53
                -value NAME -label "by Name" \
54
                -helpstr "View files by name order" \
55
                -command {puts "selected: by Name"}
56
 
57
        radiobutton byDate -variable viewMode \
58
                -value DATE -label "by Date" \
59
                -helpstr "View files by date order" \
60
                -command {puts "selected: by Date"}
61
 
62
        cascade prefs -label "Preferences" -menu {
63
            command colors -label Colors... \
64
                -helpstr "Change text colors" \
65
                -command {puts "selected: Colors..."}
66
 
67
            command fonts -label "Fonts..." \
68
                -helpstr "Change text font" \
69
                -command {puts "selected: Fonts..."}
70
        }
71
    }
72
}
73
pack .mb -fill x
74
 
75
frame .fr -width 200 -height 200 -background white
76
pack .fr -fill both
77
 
78
label .help -anchor w -textvariable helpVar -width 40
79
pack .help -fill x

powered by: WebSVN 2.1.0

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