Welcome, Guest
Please Login or Register.    Lost Password?

Can't seem to grasp the LUA
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Can't seem to grasp the LUA
#20912
Can't seem to grasp the LUA 6 Months, 3 Weeks ago  
Hi I have fiddled a little with the LUA scripts.
Trying to traverse through the various controls on a window, but can't seem to get it right.

I recently posted that it would be cool with a global value, telling that buttons are only vivsble when mouse over.

For now, the fastest but most dirty way, is to hardcode each button in each window, just like Photos.lua does.

I thought it might be possible, to play Object oriented and thus making an overall function and initialization, that took care of this.

But the documentation for Rainlendar objects and the LUA language is kinda hard to comprehend, so I need a kick off help, if anyaone can

How do i make a function like the one in Photos.lua, but for all windows, returning the given window as a parameter?

When I finally have the correct Window variable/object:
How do i traverse through the child objects and asks for buttons or any other child object for that matter?

I think that having cleared out theese two questions, we all should be able to do some more scripting on our own, or is it just me who have been away from programming too long ... :O
Oldorf
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
NNTP - Usenet - Newsgroups rocks, Forum's [CENSORED]
 
#20913
Re:Can't seem to grasp the LUA 6 Months, 3 Weeks ago  
Pseudo code:
Code:

foreach Window in AllWindows
  foreach Child in Window
    if Child == button then
      Stuff the Child
    end
  end
end


Will it blend?

Offtopic: Why can't I select text from ApiReference-English.pdf? Is there an html or something where I can copy & paste? (Found it in the Rainlendar Help.)


windows = Rainlendar_GetWindows()
TableOfItems = Rainlendar_GetAllItems(window)
value = Rainlendar_GetItemValue(window, item, field)
Rainlendar_SetItemValue(window, item, field, value)
Nilfred
Junior Boarder
Posts: 23
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Argentina
Last Edit: 2014/03/30 19:39 By Nilfred.Reason: Offtopic answer to my own question
The administrator has disabled public write access.
 
#20920
Re:Can't seem to grasp the LUA 6 Months, 3 Weeks ago  
There are couple of problems with this though. The Rainlendar_GetAllItems() returns only the items from the root and you will get only a list of identifiers so the type of the item is not known. You could try to get some value which is available for buttons only to try to find the buttons from the list.
Rainy
Moderator
Posts: 5971
graph
User Online Now Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop