Am 19.04.2016 um 15:01 schrieb Alexandru:
> That might work, but actually I need both transient and overrideredirect if I want to have a tooltip-like window always on top.
>
Maybee, again, the BWidget tooltip code in dynhelp.tcl may help you:
toplevel $_top -relief flat \
-bg [Widget::getoption $_top -topbackground] \
-bd [Widget::getoption $_top -borderwidth] \
-screen [winfo screen $w]
wm withdraw $_top
if { $Widget::_aqua } {
::tk::unsupported::MacWindowStyle style $_top help none
} else {
wm overrideredirect $_top 1
}
catch { wm attributes $_top -topmost 1 }
label $_top.label -text $string \
-relief flat -bd 0 -highlightthickness 0 \
-padx [Widget::getoption $_top -padx] \
-pady [Widget::getoption $_top -pady] \
-foreground [Widget::getoption $_top -foreground] \
-background [Widget::getoption $_top -background] \
-font [Widget::getoption $_top -font] \
-justify [Widget::getoption $_top -justify]
pack $_top.label -side left
update idletasks
if {![winfo exists $_top]} {return}
set scrwidth [winfo vrootwidth .]
set scrheight [winfo vrootheight .]
set width [winfo reqwidth $_top]
set height [winfo reqheight $_top]
# On windows multi screen configurations, the virtual screen may
start
# at negative positions.
set scrrootx [winfo vrootx .]
set scrrooty [winfo vrooty .]
# Increment the required size by the deplacement from the passed
point
incr width 8
incr height 12
# Put at the right border if going over it
if { $x+$width > $scrrootx+$scrwidth } {
set x [expr {$scrwidth + $scrrootx - $width + 8}]
} else {
incr x 8
}
# Put above widget if below is no space
if { $y+$height > $scrrooty+$scrheight } {
set y [expr {$y - $height}]
} else {
incr y 12
}
wm geometry $_top "+$x+$y"
update idletasks
if {![winfo exists $_top]} { return }
wm deiconify $_top
raise $_top
# Sometimes the tooltip does not occur under
# gnome/metacity on ubuntu.
after 5;
}
--- news://
freenews.netfront.net/ - complaints:
ne...@netfront.net ---