• FrozenEye

    Hi, I was looking for method how to access window controls like buttons, listboxes etc from a worker thread.. like:

    local thread = thread.new(function(queue)
        while true do
          local t,v,l = queue:pop(1000)
          if t then
            win.title = v
            -- and here is a trouble with access to win
            -- it is not possible to send table/cdata etc as an argument in thread.new(..)
          end
        end
      end, queue
    )
    

    Has anyone resolved such situation?
    Thanks.

    posted in General Discussion read more
  • FrozenEye

    look here for supported platforms: https://luapower.com/cplayer/info.
    Just windows x32/x64.
    Suggest to use nw, but it is still in progress... https://luapower.com/nw

    posted in General Discussion read more
  • FrozenEye

    @robertmuench said:

    If I do this, I get a seg fault 11 on OSX:

    local cairo_mask = bundle.load("cairo_mask.png")
    local cmi = libpng.load(cairo_mask)

    File opened as binary one?

    posted in General Discussion read more
  • FrozenEye

    Thanks for a response.

    posted in General Discussion read more
  • FrozenEye

    Hi, just one quesstion: is this forum alive?

    posted in General Discussion read more
  • FrozenEye

    I still get "nil Out of memory cdata<enum 568>: 27" when I try ro etr:perform()....

            local etr = curl.easy('http://xxx')
            local frm = curl.form()
            frm:add('copyname', fname, 'file', filePath, 'contenttype', 'application/octet-stream', 'contentheader', {'apikey: ' .. apikey })
    
            etr:set('httppost', frm:get())
            print(etr:perform())

    posted in General Discussion read more
  • FrozenEye

    @oscar11
    I saw this in theme.lua in luapower

    function player:line(x1, y1, x2, y2, ...)
        self.cr:move_to(x1, y1)
        self.cr:line_to(x2, y2)
        self:stroke(...)
    end

    posted in General Discussion read more
  • FrozenEye

    @Alonso-Hermosilla said:

    So I'm trying to create a simple button but I'm getting a error.

    Error: winapi/button.lua:175: non-zero expected, got zero
    stack traceback:
            [C]: in function 'error'
            winapi/util.lua:102: in function 'checknz'
            winapi/button.lua:175: in function 'Button_SetTextMargin'
            winapi/buttonclass.lua:52: in function <winapi/buttonclass.lua:48>
            winapi/vobject.lua:39: in function '__set_vproperty'
            winapi/vobject.lua:23: in function '__newindex'
            winapi/basewindowclass.lua:418: in function '__init'
            winapi/controlclass.lua:49: in function '__init'
            winapi/object.lua:32: in function 'Button'
            main.lua:14: in function 'load'
            [string "boot.lua"]:439: in function <[string "boot.lua"]:435>
            [C]: in function 'xpcall'
    

    This is the code I used.

    local winapi = require("winapi")
    require("winapi.windowclass")
    require("winapi.buttonclass")
    
    function love.load()
      local Window = winapi.Window {
          title = "löve compiler",
          autoquit = true,
          visible = true,
          w = 500,
          h = 300,
      }
      
      local Button = winapi.Button {
          text = "button",
          w = 300,
          h = 100,
          x = 50,
          y = 50,
          parent = Window
      }
    end
    

    hope, you've already resolved this... but .... you just need to:

    local winapi = require("winapi")
    require("winapi.windowclass")
    require("winapi.buttonclass")
    
    local function main()
        local Window = winapi.Window {
            title = "löve compiler",
            autoquit = true,
            visible = true,
            w = 500,
            h = 300,
        }
        
        local Button = winapi.Button {
            text = "button",
            w = 300,
            h = 100,
            x = 50,
            y = 50,
            parent = Window
        }
    
        winapi.MessageLoop()
    end
    
    main()
    

    posted in General Discussion read more
  • FrozenEye

    Hi, I've tried to upload file using libcurl like here (original):

    local easy = curl.easy()
    :setopt_url(urls.URLS.file.scan)
    :setopt_httppost(curl.form()
    :add_content('apikey', apiKey, 'text/plain')
    :add_file('file', filePath, 'application/octet-stream',
    fname, {'Content-length: ' .. fsize}
    ))
    :perform()
    :close()

    I've tried to modify it, but with no success...

    local etr = curl.easy('https://testsite.test')
    local frm = curl.form()
    frm:add('contenttype', 'multipart/form-data')
    frm:add('file', file)
    etr:set('formpost', frm)
    etr:perform()
    etr:close()

    Is there any samples for libcurl?
    Thanks!

    posted in General Discussion read more
Internal error.

Oops! Looks like something went wrong!