Shoutbox

Adding labels to a window via script - 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: Adding labels to a window via script (/showthread.php?tid=82962)

Adding labels to a window via script by Fuzzylama on 04-05-2008 at 12:33 PM

Hi
Im trying my script to create a window with different labels, but the number of labels differs each time the window is opened. Is there any function or other option to solve this?


RE: Adding labels to a window via script by mynetx on 04-05-2008 at 12:39 PM

The only current solution for this is to write the window xml just before the window is created, store the xml in a temporary file, create the window from the temporary file, then delete the file right after the window is created. :)


RE: Adding labels to a window via script by Fuzzylama on 04-05-2008 at 03:10 PM

I wondered about doing it like that but i thought there must be a better solution...:( Bu if there is no other way...
thx for reply
Fuzzylama


RE: Adding labels to a window via script by mynetx on 04-05-2008 at 03:13 PM

Probably I will add in a suggestion to add a scripting feature to add Plus window components on runtime, for a new Plus version. :)


RE: Adding labels to a window via script by Volv on 04-05-2008 at 03:22 PM

You could always just create a number of invisible labels in your xml file then set them to visible via your script as needed.


RE: Adding labels to a window via script by Fuzzylama on 04-06-2008 at 07:35 PM

quote:
Originally posted by Volv
You could always just create a number of invisible labels in your xml file then set them to visible via your script as needed.
I need to change the content of the labels so ive to create the window in the script. I've written the script now and the file is created, but the window is not... I think the problem is, that its not written in unicode is it possible to write a file in unicode with opentextfile()??
RE: Adding labels to a window via script by mynetx on 04-06-2008 at 08:22 PM

Changing the text on a label is easy from runtime: just use Wnd.SetControlText("labelId", "Text");...?

And additionally:

  • OpenTextFile Method
    object.OpenTextFile(filename[, iomode[, create[, format]]])
    Arguments

    (...)

    format

        Optional. One of three Tristate values used to indicate the format of the opened file. If omitted, the file is opened as ASCII.

    The format argument can have any of the following settings:

    [Image: vyuve0.png]

  • CreateTextFile Method

RE: Adding labels to a window via script by Fuzzylama on 04-07-2008 at 12:46 PM

ah ok thx!