Mailinglist Archive: libyui-devel (8 mails)

< Previous Next >
Re: [libyui-devel] busy and normal cursor
On Sat, Feb 01, 2014 at 08:31:41PM +0100, Angelo Naselli wrote:
I seem i cannot see it working in GTK. Is it only me?

Hi Angelo,

I have modified this example from the YaST bindings
https://github.com/yast/yast-ycp-ui-bindings/blob/0ba1d246d77b477513b9db7db6760b1f360d6f89/examples/PollInput1.rb
to add UI.BusyCursor, and I do get a busy cursor with

/sbin/yast2 --gtk PollInput1.rb

Please look in the yast bindings to find the working usage.
Maybe some other bindings or documentation need a fix, but I don't
know what you are using.
--
Martin Vidner, Cloud & Systems Management Team
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
# encoding: utf-8

module Yast
class PollInput1Client < Client
def main
Yast.import "UI"
UI.OpenDialog(
VBox(
Label(Id(:lab), "Money: 800 Euro"),
PushButton(Id(:cancel), Opt(:hstretch), "Cancel"),
PushButton(Id(:add), Opt(:hstretch), "Add 50")
)
)
@num = 800

while Ops.greater_than(@num, 0)
UI.NormalCursor
@ret = UI.PollInput
Builtins.y2milestone("%1", @ret)
if @ret == :cancel
break
elsif @ret == :add
@num = Ops.add(@num, 50)
UI.BusyCursor
end
UI.ChangeWidget(
Id(:lab),
:Value,
Ops.add(Ops.add("Money: ", @num), " Euro")
)
Builtins.sleep(500)
@num = Ops.subtract(@num, 1)
end
UI.CloseDialog

nil
end
end
end

Yast::PollInput1Client.new.main
< Previous Next >
List Navigation
References