Shoutbox

Window won't show up -_- - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Window won't show up -_- (/showthread.php?tid=90561)

Window won't show up -_- by dokueki on 05-09-2009 at 10:24 AM

I just started with the window starter tutorial on the documentation... Did everything they said, just copy/pasted and the window won't show up when I save the script D: ideas?


RE: Window won't show up -_- by Spunky on 05-09-2009 at 11:02 AM

Save the xml file as Unicode in notepad ;)


RE: Window won't show up -_- by ryxdp on 05-09-2009 at 11:07 AM

Also, if you've just copied and pasted the windows, you should make sure to change the window ids to something else, as these windows already exist in Messenger Plus! and AFAIK may cause issues when trying to create them.


RE: Window won't show up -_- by Spunky on 05-09-2009 at 11:23 AM

quote:
Originally posted by ryxdp
Also, if you've just copied and pasted the windows, you should make sure to change the window ids to something else, as these windows already exist in Messenger Plus! and AFAIK may cause issues when trying to create them.

WindowIDs do not need be unique across the board... You can use the same WindowID in for multiple windows in a single script as long as the xml for each is in a separate file. In fact, I think you can have multiple instances of the same window open too for that matter (for example the desktop contact window is re-used)
RE: Window won't show up -_- by dokueki on 05-09-2009 at 10:57 PM

quote:
Originally posted by Spunky
Save the xml file as Unicode in notepad ;)
quote:
Originally posted by ryxdp
Also, if you've just copied and pasted the windows, you should make sure to change the window ids to something else, as these windows already exist in Messenger Plus! and AFAIK may cause issues when trying to create them.
Neither works :(
RE: RE: Window won't show up -_- by ryxdp on 05-09-2009 at 11:04 PM

quote:
Originally posted by Spunky
WindowIDs do not need be unique across the board... You can use the same WindowID in for multiple windows in a single script as long as the xml for each is in a separate file. In fact, I think you can have multiple instances of the same window open too for that matter (for example the desktop contact window is re-used)

Alright then. I was thinking that if a script had a window with an id that Plus's own interface was already using, it might have confused Plus a bit.
RE: Window won't show up -_- by matty on 05-09-2009 at 11:36 PM

Post the code you use to create the window and the XML of the window itself.


RE: Window won't show up -_- by felipEx on 05-10-2009 at 12:11 AM

Try to preview your interface xml file by using MP! Interface tester and see if you can preview your window correctly (if not so, you'll get an error message telling you why the window couldn't be loaded). Also, make sure you're calling the MsgPlus.CreateWnd function correctly. ;-)


RE: RE: Window won't show up -_- by dokueki on 05-11-2009 at 02:13 PM

quote:
Originally posted by felipEx
Try to preview your interface xml file by using MP! Interface tester and see if you can preview your window correctly (if not so, you'll get an error message telling you why the window couldn't be loaded). Also, make sure you're calling the MsgPlus.CreateWnd function correctly. ;-)
It says "Error" but doesn't say what exactly. Here's the code... As copy/pasted from the docs, lol.
code:
<Interfaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Window Id="WndTest" Version="1">
        <Attributes>
            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Position ClientWidth="170" ClientHeight="45"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="LblTop">
                <Position Left="10" Top="10" Width="150"/>
                <Caption>Hello world!</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="BtnClose">
                <Position Left="115" Top="25" Width="50"/>
                <Caption>Close</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>
code:
function OnEvent_Initialize(MessengerStart)
{
    var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}
Both are in the same directory.
RE: Window won't show up -_- by matty on 05-11-2009 at 03:01 PM

First things first you are missing a big chunk of the header:

xml code:
>>><?xml version="1.0" encoding="UTF-16"?><<<
>>><Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd"><<<
    <Window Id="WndTest" Version="1">
        <Attributes>
            <Caption>Test Window</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text>Hello!</Text></Title>
        </TitleBar>
        <Position ClientWidth="170" ClientHeight="45"/>
        <DialogTmpl/>
        <Controls>
            <Control xsi:type="StaticControl" Id="LblTop">
                <Position Left="10" Top="10" Width="150"/>
                <Caption>Hello world!</Caption>
            </Control>
            <Control xsi:type="ButtonControl" Id="BtnClose">
                <Position Left="115" Top="25" Width="50"/>
                <Caption>Close</Caption>
            </Control>
        </Controls>
    </Window>
</Interfaces>

RE: Window won't show up -_- by Spunky on 05-11-2009 at 03:47 PM

quote:
Originally posted by matty
First things first you are missing a big chunk of the header:

If that is the case, the Scripting Docs need to have that page updated...
RE: Window won't show up -_- by matty on 05-11-2009 at 06:11 PM

What page are you looking at? The XML Schemas Reference > Interface Windows > Information has:

xml code:
<Interfaces xmlns="urn:msgplus:interface"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd">
    <Window>...</Window>
</Interfaces>

The XML Schemas Reference > Interface Windows > Examples has:
xml code:
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd">
   
<Window Id="SoundTransfer400" Version="1">
    <Attributes>
        <ShowInTaskbar>false</ShowInTaskbar>
    </Attributes>
   
    <TitleBar>
        <AllowMinimize>false</AllowMinimize>
        <AllowClose>false</AllowClose>
    </TitleBar>
   
    <Position Width="200" Height="60"/>
   
    <DialogTmpl>   
        <BottomBar Style="None">
            <LeftControls>
                <Control xsi:type="ProgressControl" Id="PrgWait">
                     <Position Top="5" Width="100" Left="0" Height="10"/>
                    <Marquee/>
                </Control>
            </LeftControls>

            <RightControls>
                <Control     xsi:type="ButtonControl" Id="BtnCancel">
                    <Position Top="0" Width="50" Left="0"/>
                    <Caption>&amp;Cancel</Caption>
                </Control>
            </RightControls>
        </BottomBar>
    </DialogTmpl>
   
    <Elements>
        <Element     xsi:type="ImageElement" Id="ImgSound">
            <Position Top="5" Left="6"/>
            <Image><Name>icon-speaker</Name></Image>
        </Element>
    </Elements>
   
    <Controls>
        <Control xsi:type="StaticControl" Id="LblMessage">
            <Position Top="5" Width="150" Left="32" Height="20"/>
            <Attributes>
                <WrapText>true</WrapText>
            </Attributes>
            <Caption>Please wait...\nThe sound is being sent.</Caption>
        </Control>
    </Controls>
</Window>

</Interfaces>

RE: Window won't show up -_- by Spunky on 05-11-2009 at 09:06 PM

Working With scripts > Windows For Your Script


RE: Window won't show up -_- by matty on 05-12-2009 at 12:43 PM

* matty slaps Pitcho


RE: Window won't show up -_- by dokueki on 05-12-2009 at 02:06 PM

Still doesn't work, gives an error in the tester :\ btw, those chunks weren't in the docs.