| Problem with Plus windows.. | 
| Author: | Message: | 
| SmokingCookie Senior Member
 
     
 
  
 Posts: 815
 Reputation: 15
 31 /
  /  Joined: Jul 2007
 
 | | O.P.  Problem with Plus windows.. Hi, 
I can't get ANY Plus! window to show an image background. 
Can anybody tell me what I've done wrong (this time)?
 
The .JS code:
 code:function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
 if(Message == "/OpenWnd") {
 var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
 }
 }
 
 
 
The XML code:
 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="WndAbt" Version="1">
 <Attributes>
 <Caption>TestWindow</Caption>
 </Attributes>
 
 <TitleBar>
 <AllowMinimize>false</AllowMinimize>
 <Title>
 <Text>TestWindow</Text>
 </Title>
 </TitleBar>
 <Position Width="860" Height="600"/>
 <DialogTmpl/>
 </Window>
 <Elements>
 <Element xsi:type="ImageElement" Id="ImgBackgrnd">
 <Position Top="100" Left="100"/>
 <Image>
 <Name>C:\Program Files\Messenger Plus! Live\Scripts\New Message Alert\IMG\Backgrnd</Name>
 <Format>PNG</Format>
 </Image>
 </Element>
 </Elements>
 </Interfaces>
 
 
This post was edited on 01-04-2008 at 06:07 PM by SmokingCookie.
 | 
 | 
| 01-04-2008 06:07 PM |  | 
|  | 
| matty Scripting Guru
 
      
 
 Posts: 8327
 Reputation: 109
 40 /
  /  Joined: Dec 2002
 Status: Away
 
 | | RE: Problem with Plus windows.. You cannot specify the image like that.
 You have 2 options
 
 Option 1:
 Put the image in an Images directory and just put the filename between <name></name>
 
 Option 2:
 Set the image by using code that way you can specify the full path.
 | 
 | 
| 01-04-2008 06:11 PM |  | 
|  | 
| pollolibredegrasa Full Member
 
    
 
  formerly fatfreechicken
 
 Posts: 483
 Reputation: 34
 36 /
  /  Joined: May 2005
 
 | | RE: Problem with Plus windows.. quote:Originally posted by SmokingCookie
 
 
 code:<Name>C:\Program Files\Messenger Plus! Live\Scripts\New Message Alert\IMG\Backgrnd</Name>
 
 
 
 
If you supply a full path to the image then you need to prefix it with \.
 
However, if you create a folder in your script's folder called "images", and place your images in there then you don't need to supply a full path at all, you just need to put the image name   bah beaten to it...This post was edited on 01-04-2008 at 06:14 PM by pollolibredegrasa.
 ;p
 
 ![[Image: chickennana.gif]](http://shoutbox.menthix.net/images/smilies/chickennana.gif) Vaccy is my thin twin! ![[Image: chickennana.gif]](http://shoutbox.menthix.net/images/smilies/chickennana.gif) | 
 | 
| 01-04-2008 06:14 PM |  | 
|  | 
| SmokingCookie Senior Member
 
     
 
  
 Posts: 815
 Reputation: 15
 31 /
  /  Joined: Jul 2007
 
 | | O.P.  RE: RE: Problem with Plus windows.. quote:Originally posted by matty
 You cannot specify the image like that.
 
 You have 2 options
 
 Option 1:
 Put the image in an Images directory and just put the filename between <name></name>
 
 Option 2:
 Set the image by using code that way you can specify the full path.
 
 
First option didn't work.. I never knew about your 2nd option.. Could you please explane it (if possible with a clear example)? Btw, I'm a bit new to scripting.. | 
 | 
| 01-04-2008 06:17 PM |  | 
|  | 
| matty Scripting Guru
 
      
 
 Posts: 8327
 Reputation: 109
 40 /
  /  Joined: Dec 2002
 Status: Away
 
 | | RE: Problem with Plus windows.. code:function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
 if(Message == "/OpenWnd") {
 var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
 Wnd.ImageElmt_SetImageFile('ImgBackgrnd', '\\'+Messenger.ScriptFilesPath+'\\Images\\Background.png'); //i am assuming it is a png file.
 }
 }
 
 | 
 | 
| 01-04-2008 06:49 PM |  | 
|  | 
| SmokingCookie Senior Member
 
     
 
  
 Posts: 815
 Reputation: 15
 31 /
  /  Joined: Jul 2007
 
 | | O.P.  RE: Problem with Plus windows.. THANKS!!!!!   | 
 | 
| 01-04-2008 06:53 PM |  | 
|  | 
| Matti Elite Member
 
      
 
  Script Developer and Helper
 
 Posts: 1646
 Reputation: 39
 33 /
  /  Joined: Apr 2004
 
 | | RE: Problem with Plus windows.. Although it's recommended that you just place your images in the "Images" folder, so you don't even need to call ImageElmt_SetImageFile. It would be a pain in the @$$ if you have to call that function for every image in your window, and even then, you wouldn't be able to use images in buttons, combo-box controls,... | 
 | 
| 01-04-2008 07:07 PM |  | 
|  | 
| SmokingCookie Senior Member
 
     
 
  
 Posts: 815
 Reputation: 15
 31 /
  /  Joined: Jul 2007
 
 | | O.P.  RE: Problem with Plus windows.. Well, it's working now, so I don't care about images in buttons.. I can also use text, like "close" or "sluiten" (Dutch for "close").. 
EDIT:: I've got 3 days of "vakantie"    
EDIT2:: Can I also use this as a remote command? Like:
 code:function OnEvent_ChatWndReceiveMessage(ChatWnd, Message) {
 if(Message == "!OpenWnd") {
 var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
 }
 }
 
 
This post was edited on 01-04-2008 at 07:22 PM by SmokingCookie.
 | 
 | 
| 01-04-2008 07:13 PM |  | 
|  | 
| Matti Elite Member
 
      
 
  Script Developer and Helper
 
 Posts: 1646
 Reputation: 39
 33 /
  /  Joined: Apr 2004
 
 | | RE: Problem with Plus windows.. quote:Originally posted by SmokingCookie
 Can I also use this as a remote command? Like:
 
 
 code:function OnEvent_ChatWndReceiveMessage(ChatWnd, Message) {
 if(Message == "!OpenWnd") {
 var Wnd = MsgPlus.CreateWnd("Windows.xml", "WndAbt");
 }
 }
 
 
 
 Sure, why not. However, I don't see the point of a remote command which opens a window.   | 
 | 
| 01-04-2008 07:58 PM |  | 
|  | 
| SmokingCookie Senior Member
 
     
 
  
 Posts: 815
 Reputation: 15
 31 /
  /  Joined: Jul 2007
 
 | | O.P.  RE: Problem with Plus windows.. 'Coz I'm thinkong of doing it in future scripts   Merci, et bonne fin des vacanses  
(sorry, that's what little French I speak.. Have lessons at school    )This post was edited on 01-04-2008 at 08:04 PM by SmokingCookie.
 | 
 | 
| 01-04-2008 08:03 PM |  | 
|  | 
|  |