[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pop-Up Text?






I use a little program I wrote that works great. I posted on the LDM group
in Aug 2001. I call it "ldmxnotify"
There is a timer in the program that removes the pop up after a specified
period. I also have "bell" command
in there that will beep on pop-up.


Here is the text from that email that has the script with it. If you have
any questions let me know.

Mike


Hi,

A couple of months ago I sent a note with the tcl/tk script that will
pop-up an X window with a
bulletin from the LDM. This is nice, so you don't have to print every
statement, warning etc.

Today I added the ability to print the bulletin, via a print button. So I
thought I would pass it along.

In order to run this you must have tcl/tk installed, many systems do. I am
running
this on Linux.

In order to print you must have your printer defined, ie  lp0 in my case.

An example pqact.conf entry that will pop-up any Tropical Bulletins from
the NHC:

DDPLUS  ^WTNT.. KNHC
        PIPE    -strip -close /weather/ldm/bin/ldmxnotify -d wxdata3:0 lp0


The '-d wxdata3:0' is the X display definition
The 'lp0'  is the print spool.


If you have any questions let me know,

Mike Dross

Below is the script:

ldmxnotify
-------------->
#!/usr/bin/wish

# gets printer spool name from command line variable argv

# take the stdin text and assign to variable $info
set info [exec cat]

text .xstdin -yscrollcommand {.s set}
.xstdin insert 1.0 $info

scrollbar .s -orient vertical -command {.xstdin yview}
button .b1 -text Exit -command exit
button .b2 -text "Print" -command Prnt

# .b1 gets the entire bottom of the window.
pack .b1 -side bottom
pack .b2 -side bottom

# Pack .s next, so that if the user decreases the size
# of the window, the Text widget shrinks instead of
# the Scrollbar. .s gets the right-hand side of the space
# left over. It fills it vertically.
pack .s -side right -fill y

# Pack .xstdin last. Expand its packing space into
# any additional space that becomes available if the
# user resizes the window. Have the Text widget
# completely fill its packing space.
pack .xstdin -expand yes -fill both

# Beep on pop-up
bell

# Sleep 5 minutes (300,000 milliseconds) then close window
after 300000 exit


proc Prnt {} {
# Make info a global variable otherwise would not get read in a prodcedure
global info  argv

# Spool to printer
exec lpr -P$argv <<$info
}

________________________________________________________
Michael Dross                             address@hidden
Duke Power Company                  Meteorologist/Scientist
9700 David Taylor Dr.               Voice: 704-594-0341
Charlotte, NC 28269                       Mobile: 980-722-0756


|---------+----------------------------->
|         |           "Rob Dale"        |
|         |           <address@hidden|
|         |           g>                |
|         |           Sent by:          |
|         |           address@hidden|
|         |           ta.ucar.edu       |
|         |                             |
|         |                             |
|         |           08/08/2004 06:22  |
|         |           PM                |
|         |                             |
|---------+----------------------------->
  
>-------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                  |
  |       To:       <address@hidden>                                            
                                         |
  |       cc:                                                                   
                                                  |
  |       Subject:  Pop-Up Text?                                                
                                                  |
  
>-------------------------------------------------------------------------------------------------------------------------------|




Nalarm comes in very handy, but is there a way to have a window pop-up or
audibly alert for priority products? I've tried using a terminal window to
do that but not succeeding.

 - Rob





NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.