David Andel wrote:
> Hi
> When using
> wm overrideredirect . yes
> bind actions seems not to work. Anyway if I bind them to '.', the frame
> generated in '.' or to 'all'. If using window decorations by commenting
> out the above line, bind actions work fine.
> Is there a way to make them work in the case without window decorations
> as well?
David
I can only post some code that I have that works (under Linux) and you can
see where yours differs in implementation.
This code is supposed to give an icon button at top left of screen and it
has context menu attached.
HTH
Rob.
---------------------------------------------------------------------
#!/bin/sh
# \
exec wish "$0" ${1+"$@"}
package require Img
wm overrideredirect . 1
set imgfile "/usr/share/icons/favicons/skype.png"
image create photo img -file $imgfile
set fraBorderWidth 2
frame .f -borderwidth $fraBorderWidth
set frameDefaultColour [.f cget -background]
pack .f
button .f.b -image img -relief raised -borderwidth 4
pack .f.b
set contextMenu [menu .popmenu -tearoff 0]
$contextMenu add command -label "Quit" -accelerator "Alt+F4" -command {exit}
$contextMenu add separator
$contextMenu add command -label "Properties..." -command {}
bind .f.b <ButtonRelease-3> {tk_popup .popmenu [winfo pointerx .] [winfo
pointery .]}
bind . <Enter> {.f configure -bg red}
bind . <Leave> {.f configure -bg $frameDefaultColour}
bind . <Unmap> {wm deiconify .
focus -force}
---------------------------------------------------------------------