A window that is always on top?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

A window that is always on top?

Michael Meyer-6
Hi
is it possible to have a window that is always on top?
The code below creates a window that looks like what I want. The problem is that the window disappears when I click on an other window.

Cheers, michael

| window |
window := ScheduledWindow new.
window minimumSize: 200 @ 100.
window windowType: #popUp.
window component: (LookPreferences edgeDecorator on: (TextEditorView model: 'Text')).
window open.

Reply | Threaded
Open this post in threaded view
|

RE: A window that is always on top?

Steven Kelly
> From: Michael Meyer [mailto:[hidden email]]
> Sent: 23 September 2006 01:11
>
> is it possible to have a window that is always on top?

I don't know if this code works anymore, but here's what we used back in
VW3.0. It's mostly intended to set up something like a floating toolbar
for the mainWindow argument, but that can be nil. The
#palettePlaceNear:for: method just returns a good starting origin for
the window position.

HTH,
Steve

openNear: mainWindow
        | temp tempAdaptor |
        mainWindow notNil
                ifTrue: [builder window openIn: ((self palettePlaceNear:
mainWindow for: builder window extent)
                                        extent: builder window extent)
                                withType: #reserved]
                ifFalse: [builder window openWithType: #reserved].
        (UIPainter preferenceFor: #hostWindowManager) value ==
#MSWindows ifTrue: ["MS Windows needs to be told twice if the window is
thinner than 100
                pixels."
                builder window displayBox: builder window displayBox].
        builder window application: mainWindow application.
        mainWindow sendWindowEvents: #(#close #collapse #expand).
        builder window beSlave; receiveWindowEvents: #(#close #collapse
#expand).
        builder window windowEventBlock:
                [ :w :ev :ow | | return |
                return:= false.
                ev key = #collapse ifTrue: [w model isMapped ifTrue: [w
windowType: #normal] ifFalse: [return:=true]].
                ev key = #expand ifTrue: [w model isMapped ifTrue: [w
windowType: #reserved] ifFalse: [return:=true]].
                ev key = #close ifTrue: [mayReallyClose := true].
                return].
        ^builder window


Reply | Threaded
Open this post in threaded view
|

Re: A window that is always on top?

Runar Jordahl
In reply to this post by Michael Meyer-6
You might want to look at my package "Epigent Application Window
Styles": http://www.cincomsmalltalk.com/userblogs/runarj/blogView?showComments=true&entry=3308039622

The package adds support for setting special application windows
styles. This includes for example the window's transparency, its icons
and allowed operations. Looking at the code, you might be able to add
support for what you want.

Runar Jordahl

Reply | Threaded
Open this post in threaded view
|

Re: A window that is always on top?

Michael Meyer-6
In reply to this post by Michael Meyer-6
Thanks for all the suggestions. The windowType #reserved does exactly what I want on windows :-)
Unfortunately I also need to support osx and x11. On these platforms #reserved doesn't seem to work:

osx: #reserved behaves like #popUp
x11: #reserved behaves like #dialog

There is no similar easy solution for these platforms, right?

Cheers, michael

Reply | Threaded
Open this post in threaded view
|

Re: A window that is always on top?

Karsten Kusche
hi michael,

i'm not sure how this is done in smalltalk, or if you can access the
'c'-side (not seaside ;-) ) directly, but in os x you can set the
window-level to NSFloatingWindowLevel and the window is always frontmost.
sorry, i can't be of more help

Karsten



Michael Meyer wrote:

> Thanks for all the suggestions. The windowType #reserved does exactly
> what I want on windows :-)
> Unfortunately I also need to support osx and x11. On these platforms
> #reserved doesn't seem to work:
>
> osx: #reserved behaves like #popUp
> x11: #reserved behaves like #dialog
>
> There is no similar easy solution for these platforms, right?
>
> Cheers, michael
>
>

Reply | Threaded
Open this post in threaded view
|

Re: A window that is always on top?

Andre Schnoor

I think it's well worth to support this behavior officially in 7.5, i.e.
map some unique symbol to "always on top" and implement its behavior for
each platform that supports this kind of window. I guess there are many
applications out there that can benefit from floating control panels,
dashboards, side bars, whatever (mine included). For todays desktop
apps, this is a well-established standard.

BTW: Thanks for the Mac information. I'm still waiting for the new OSX
VM in order to be able to fix all the GUI details for that platform.

Andre


Karsten Kusche schrieb:

> hi michael,
>
> i'm not sure how this is done in smalltalk, or if you can access the
> 'c'-side (not seaside ;-) ) directly, but in os x you can set the
> window-level to NSFloatingWindowLevel and the window is always frontmost.
> sorry, i can't be of more help
>
> Karsten
>
>
>
> Michael Meyer wrote:
>> Thanks for all the suggestions. The windowType #reserved does exactly
>> what I want on windows :-)
>> Unfortunately I also need to support osx and x11. On these platforms
>> #reserved doesn't seem to work:
>>
>> osx: #reserved behaves like #popUp
>> x11: #reserved behaves like #dialog
>>
>> There is no similar easy solution for these platforms, right?
>>
>> Cheers, michael
>>
>>
>
>