=> On [2012-06-16 15:05:13 +0200]:
 Zsolt Udvari Said: 
> > line = statements_file.read(statements_file)
> Hm, the linked example was wrong? Check: http://www.lua.org/pil/21.1.html
> If you want read only one line:
> line = statements_file.read("*line")
I solved it now.
here is the result:

    mytextword = widget({ type = "textbox" })
    -- mytextword.text = "" .. ccyan .. "九州 - 海上牧云记 » " .. coldef .. cred .. " 
牧云笙 " .. coldef .. ""

    statements_file = io.open(configdir .. "/statements.txt", "r")
    mytimer = timer({ timeout = 60*5 })
    mytimer:add_signal("timeout", function()
        text_line = statements_file:read("*line")
        if text_line then
            mytextword.text =  "" .. cred .. "九州 - 海上牧云记 » " .. coldef .. ccyan 
.. text_line .. coldef .. ""
        else
            statements_file:seek("set")
            -- "set": begin of file, "cur": current line, "end": end of file.
        end
    end)
    mytimer:start()

> -- 
> To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

-- 
[ stardiviner ] ^^&^^ {I hate all of you !  Leave me alone}
IRC(freenode): stardiviner     \\ Twitter:  @numbchild \\
GnuPG Key fingerprint
    >>> 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433

Attachment: signature.asc
Description: Digital signature

Reply via email to