Chromeless Xul Window Draggable???

View: New views
4 Messages — Rating Filter:   Alert me  

Chromeless Xul Window Draggable???

by ivanicus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello people!!!

I have a xulrunner application that goes to a predefined width+height
on startup and has no chrome:

[code]
<window
        id = "mainwindow"
        title = "My Window Title"
        hidechrome = "true"
        width = "800"
        height = "600"
        xmlns  = "http://www.mozilla.org/keymaster/gatekeeper/
there.is.only.xul"
        xmlns:html = "http://www.w3.org/1999/xhtml">
        <script src="xulbrowser.js"/>
        <browser flex="1" id="browser" src="" type="content-primary" />
</window>
[/code]

My questions:

1) Is it possible to make that whole window draggable without adding
the system chrome??? I could another element inside that window above
the <browser> element and tell it to be draggable... But I have no
idea if that's even possible at all, needless to say, how to
accomplish it...

2) In such scenario, could I send some kind of event to the XUL
window, in order to minimize it/maximize it??? The event would be sent
from the application running inside the <browser> element...

Thanks in advance!!!!
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul

Re: Chromeless Xul Window Draggable???

by Arivald :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ivanicus pisze:

> Hello people!!!
>
> I have a xulrunner application that goes to a predefined width+height
> on startup and has no chrome:
>
> [code]
> <window
> id = "mainwindow"
> title = "My Window Title"
> hidechrome = "true"
> width = "800"
> height = "600"
> xmlns  = "http://www.mozilla.org/keymaster/gatekeeper/
> there.is.only.xul"
> xmlns:html = "http://www.w3.org/1999/xhtml">
> <script src="xulbrowser.js"/>
> <browser flex="1" id="browser" src="" type="content-primary" />
> </window>
> [/code]
>
> My questions:
>
> 1) Is it possible to make that whole window draggable without adding
> the system chrome??? I could another element inside that window above
> the <browser> element and tell it to be draggable... But I have no
> idea if that's even possible at all, needless to say, how to
> accomplish it...
>
> 2) In such scenario, could I send some kind of event to the XUL
> window, in order to minimize it/maximize it??? The event would be sent
> from the application running inside the <browser> element...
>
> Thanks in advance!!!!

If you cover <browser> by anything, then it will not get mouse events.

I think solution will be:
1) if you want to drag window, then JS should call some me method in
<window>.
2) This method first create <canvas>, render current browser state into
canvas, and place canvas over <browser>. Of course canvas should handle
mouse events, and move window according to mouse move.
3) when you detect drag is done, just hide/destroy canvas.

But it is a bit ugly. While dragging, app will look like frozen. To
avoid this, you may frequently (30 fps?) render browser into canvas.

But i think best solution it will be add some XUL, and just hide it when
it is not needed. Code will show drag grips only when drag is requested.

--
Arivald
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul

Re: Chromeless Xul Window Draggable???

by Neil-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ivanicus wrote:

>Is it possible to make that whole window draggable without adding the system chrome??? I could another element inside that window above the <browser> element and tell it to be draggable... But I have no idea if that's even possible at all, needless to say, how to accomplish it...
>
I've never used it, but the <titlebar> element looks relevant.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul

Re: Chromeless Xul Window Draggable???

by ivanicus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@Arivald:

Actually, when I meant above, I meant on top, but not covering it...
as a titlebar or smth like that

@neil:

<titlebar> DOES the trick!!! THANKS!!!!!!
_______________________________________________
dev-tech-xul mailing list
dev-tech-xul@...
https://lists.mozilla.org/listinfo/dev-tech-xul
LightInTheBox - Buy quality products at wholesale price!