1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
|
WindowTitle {FvwmScript-ComExample}
WindowSize 360 290
Font -adobe-helvetica-bold-r-*-*-12-*
Init
Begin
# set the com name
Set $pid = (GetPid)
Set $ComName = {ComExample-}$pid
# defined when build
Set $DATADIR = {xFVWM_DATADIRx}
Set $Perl = {xPERLx}
# run fvwm-script-ComExample.pl
Do {Exec }$Perl{ -w }$DATADIR{/fvwm-script-ComExample.pl --com-name=}$ComName{ &}
# startup cmd
Set $Startup = (SendMsgAndGet $ComName {startup} 1)
If $Startup == 0 Then
Set $tmp = {An error occur at startup!}
Else
Set $tmp = $Startup
ChangeTitle 10 $tmp
End
#----------------------------------------
# Title
Widget 10
Property
Position 10 10
Size 340 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {}
Main
Case message of
SingleClic :
Begin
End
End
Widget 11
Property
Flags NoReliefString
Position 10 35
Size 340 205
Type Rectangle
Main
Case message of
SingleClic :
Begin
End
End
#---------------------------------------
# count
Widget 20
Property
Flags NoReliefString
Position 30 60
Size 150 20
Type PushButton
Title {Send Msg Count}
Main
Case message of
SingleClic :
Begin
Set $tmp = (SendMsgAndGet $ComName {count} 1)
ChangeTitle 21 $tmp
End
End
Widget 21
Property
Position 190 60
Size 150 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {No count Msg Send}
Main
Case message of
SingleClic :
Begin
End
End
#---------------------------------------
# an unkwon msg
Widget 30
Property
Flags NoReliefString
Position 30 100
Size 150 20
Type PushButton
Title {Send An Unknown Msg}
Main
Case message of
SingleClic :
Begin
Set $tmp = (SendMsgAndGet $ComName {unknown} 1)
Set $tmp = {Returned value: }$tmp
ChangeTitle 31 $tmp
End
End
Widget 31
Property
Position 190 100
Size 150 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {No unknown Msg Send}
Main
Case message of
SingleClic :
Begin
End
End
#---------------------------------------
# A "multilines" answer
Widget 40
Property
Flags NoReliefString
Position 30 140
Size 150 20
Type PushButton
Title {A "Multilines" Msg}
Main
Case message of
SingleClic :
Begin
Set $tmp = (SendMsgAndGet $ComName {multilines} 1)
Set $t1 = (Parse $tmp 1)
Set $t2 = (Parse $tmp 2)
Set $t3 = (Parse $tmp 3)
ChangeTitle 41 $t1
ChangeTitle 42 $t2
ChangeTitle 43 $t3
End
End
Widget 41
Property
Position 190 140
Size 150 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {No multiline Msg Send}
Main
Case message of
SingleClic :
Begin
End
End
Widget 42
Property
Position 190 170
Size 150 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {No multilines Msg Send}
Main
Case message of
SingleClic :
Begin
End
End
Widget 43
Property
Position 190 200
Size 150 20
Flags NoReliefString NoFocus
Type ItemDraw
Title {No multilines Msg Send}
Main
Case message of
SingleClic :
Begin
End
End
#---------------------------------------
# Quit
Widget 99
Property
Size 80 20
Position 250 250
Flags NoReliefString
Type PushButton
Title {Quit}
Main
Case message of
SingleClic :
Begin
# say to fvwm-script-ComExample.pl to exit the 0 says that we do not
# need an answer
Set $dummy = (SendMsgAndGet $ComName {exit} 0)
Quit
End
End
|