From: A S <lio...@us...> - 2004-10-24 14:06:53
|
Update of /cvsroot/amsn/amsn-extras/plugins/movewin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10582 Added Files: movewin.tcl plugininfo.xml Log Message: initial version --- NEW FILE: plugininfo.xml --- <?xml version="1.0"?> <plugin> <name>movewin</name> <author>lio_lion (Arieh Schneier)</author> <description>Move chat windows when they are created.</description> <amsn_version>0.94</amsn_version> <plugin_version>0.1</plugin_version> <plugin_file>movewin.tcl</plugin_file> <plugin_namespace>movewin</plugin_namespace> <init_procedure>Init</init_procedure> </plugin> --- NEW FILE: movewin.tcl --- namespace eval ::movewin { variable config variable configlist proc Init { dir } { ::plugins::RegisterPlugin movewin ::plugins::RegisterEvent movewin new_chatwindow move ::plugins::RegisterEvent movewin chat_msg_received message array set ::movewin::config { x {0} y {0} state {} } set ::movewin::configlist [list \ [list str "x position" x] \ [list str "y position" y] \ [list str "only in state (blank for any)" state] \ ] } proc ::movewin::on { } { global automessage if { $::movewin::config(state) == "" } { return 1 } if { [info exists automessage] && $automessage != -1 \ && [lindex $automessage 0] == $::movewin::config(state) \ } { return 1 } else { return 0 } } proc ::movewin::move { event epvar } { upvar 2 $epvar vars if { [::movewin::on] } { wm geometry $vars(win) +$::movewin::config(x)+$::movewin::config(y) wm state $vars(win) normal } } proc ::movewin::message { event epvar } { upvar 2 $epvar vars upvar 2 $vars(chatid) chatid if { [::movewin::on] } { wm state [::ChatWindow::For $chatid] normal } } } |