Jump to content




Window API CC1.6?

api lua help

2 replies to this topic

#1 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 02 April 2014 - 10:10 PM

Okay so I have no idea how to use this new Window API from the pre-release of ComputerCraft 1.6! I took this off the actual computer using
help window
in the shell.

Window API:
window.create(parent, intX, intY, intWidth, intHeight, bolVisible)

I don't understand the "parent" bit? what is this? I have tried a string, an integer, a boolean. Nothing works. It says it is expecting an object.. Now I have been using CC for about a year and a bit but I don't actually understand what it is asking for... a table? and if so how is the table supposed to be structured? It isn't explained anywhere (that I have searched) and not in the API's list.

Can someone please help me?

also do you use the following code to actually make a window?
window1 = window.create(parent, intX, intY, intWidth, intHeight, bolVisible)
then use:
window1.write("Hello World!")
???
I think that is the write syntax?:S

Also!! The mod has a few problems with it's file system, when I installed it, all my computers shared the same file system >.< so I couldn't use different startup programs... It has stopped now, but sometimes reverts to it.

Thanks guys!!

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 02 April 2014 - 10:18 PM

the parent is suggested to be a call to term.current1

as for the bugs, they're well and truly known that they've made it to the full release.

1 taken directly from ComputerCraft Window API source (as the wiki page is not yet made)
function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
  --# snip validation

  if parent == term then
	error( "term is not a recommended window parent, try term.current() instead", 2 )
  end

  --# snip remainder of code
end

Edited by theoriginalbit, 02 April 2014 - 10:19 PM.


#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 April 2014 - 10:19 PM

I believe the first parameter wants a redirect object. Try passing term.current().





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users