1 second pop-up, timed message
-
I can't seem to find how I can give a quick confirmation, like displaying 1 second: "Hello world" without the need to press [OK] or [X]
I thought I've found it, but it doesn't work:
dlg = UI::WebDialog.new("test", false, "test", 300, 200, 50, 150, false) dlg.set_html("Hello world") dlg.show start_timer(1, false) { dlg.close }It does sometimes disappear but even when I don't use
start_timer(1, false) { dlg.close }So that seems to be another bug?!
Maybe only in SU 2013... -
Try:
module Onidarbe def self;;popup(message) # unless @dlg @dlg = UI;;WebDialog.new("Notice", false, "Onidarbe_Popup", 300, 200, 50, 150, false) end @dlg.set_html(message) if @dlg.visible? @dlg.bring_to_front else RUBY_PLATFORM =~ /darwin/i ? @dlg.show_modal ; @dlg.show end UI;;start_timer(1.0, false) { @dlg.close } # end # popup endOnidarbe::popup("Operation complete.")reasons:
- local vars in scripts get garbage collected soon after the script ends.
- all your code needs to be inside your own module
- you were attempting to call the
start_timermodule function without qualifying it by it's module. (It is not a global method.)

-
Short and ride to the point

Thanks again Dan! Have a nice new year's eve...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement