Help requested with Jive/Lua/Applets again: popup messages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chill
    Senior Member
    • Mar 2007
    • 2233

    Help requested with Jive/Lua/Applets again: popup messages

    I'm writing an applet for use on a Joggler running Jivelite under Ubuntu 18.04. The code from the Doomsday example in the wiki (here) seems to produce a popup message, but it stays on screen indefinitely, regardless of the number of milliseconds that I specify.

    Code:
    function warnMasses(self, warning)
           log:info(self:string(warning))
     
           -- create a Popup object, using already established 'toast_popup_text' skin style
           local doomsday = Popup('toast_popup_text')
     
           -- add message to popup
           local doomsdayMessage = Group("group", {
                           text = Textarea('toast_popup_textarea',self:string(warning)),
                 })
           doomsday:addWidget(doomsdayMessage)
     
           -- display the message for 3 seconds
           doomsday:showBriefly(3000, nil, Window.transitionPushPopupUp, Window.transitionPushPopupDown)
     end
    I've tried various values, in case the units aren't actually milliseconds, but the only way I can clear the message is to back out of the current window. The window behind the message stays active, and touching the popup message selects the menu item on the window behind.

    I'm calling this function from within the checkbox function with a call of the type:
    Code:
    self:warnMasses("Warning" .. device)
    Any ideas what I could be doing wrong? I noticed the same behaviour with an Applet that I did not write, so could there be an incompatibility with Ubuntu 18.04?
  • chill
    Senior Member
    • Mar 2007
    • 2233

    #2
    I found a different implementation of a popup message display (in the Screenshot applet), and put it into a standalone function. This version disappears after the specified number of milliseconds. I'm assuming the problem with the earlier version is in the 'showBriefly' method, but since the version below works I can worry about that later.
    Code:
    -- This is a simple on-screen message.
    function mypopup(self, msg, millis)
    	local popup = Popup("toast_popup")
    	local group = Group("group", {
    		text = Textarea('toast_popup_textarea',msg),
    	})
    	popup:addWidget(group)
    
    	popup:addTimer(millis, function()
    		popup:hide()
    	end)
    	self:tieAndShowWindow(popup)
    end

    Comment

    Working...