Need some direction on the GuiMlTextCtrl Gui
by DreamPharaoh · in General Discussion · 01/23/2012 (8:14 pm) · 0 replies
I have spent the entire day trying to figure out how to use a simple slider ctrl parenting a GuiMLTextCtrl that uses this script to load a simple text file:
_______________________________________________________________
function ClassDescriptionGui::ClassScroller( %theControl )
{
%theControl.setValue(""); // Clear it
%file = new FileObject();
//set the title text
%ClassLink = "./Sirenth Test.txt";
%fileName = expandFileName( %ClassLink );
echo( "Attempt to open " , %fileName );
%fileIsOpen = %file.openForRead( %fileName );
echo( "Open for read " , (%fileIsOpen ? "succeeded" : "failed" ) );
if( %fileIsOpen ) {
%tagid = "4";
%theControl.scrolltoTag(%tagid);
echo(%tagid);
%currentLine = %file.readLine();
%theControl.addText( %currentLine, true );
}
if( %theControl.isVisible() ) %theControl.forceReflow();
%file.close();
%file.delete();
}
__________________________________________________
I have tried every variation to attempt to get the tag functionality to work by putting <tag:4> in the Sirenth text file that contains the class info that the gui is to scroll at, but it keeps stating in the console... "GuiMLTextCtrl::scrollToTag - tag id 4 not found!"
I cannot find anything that actually shows a logical example of how to use this function. Some articles discuss using tagid others say simply tag, both older books have little direction on it. Thank you for any help on this one.
_______________________________________________________________
function ClassDescriptionGui::ClassScroller( %theControl )
{
%theControl.setValue(""); // Clear it
%file = new FileObject();
//set the title text
%ClassLink = "./Sirenth Test.txt";
%fileName = expandFileName( %ClassLink );
echo( "Attempt to open " , %fileName );
%fileIsOpen = %file.openForRead( %fileName );
echo( "Open for read " , (%fileIsOpen ? "succeeded" : "failed" ) );
if( %fileIsOpen ) {
%tagid = "4";
%theControl.scrolltoTag(%tagid);
echo(%tagid);
%currentLine = %file.readLine();
%theControl.addText( %currentLine, true );
}
if( %theControl.isVisible() ) %theControl.forceReflow();
%file.close();
%file.delete();
}
__________________________________________________
I have tried every variation to attempt to get the tag functionality to work by putting <tag:4> in the Sirenth text file that contains the class info that the gui is to scroll at, but it keeps stating in the console... "GuiMLTextCtrl::scrollToTag - tag id 4 not found!"
I cannot find anything that actually shows a logical example of how to use this function. Some articles discuss using tagid others say simply tag, both older books have little direction on it. Thank you for any help on this one.
About the author
If you want to learn more, please go to my website. GodsandNemesis.com.