URL:
  <http://gna.org/patch/?2767>

                 Summary: Adds wesnoth.set_dialog_active function to Lua
                 Project: Battle for Wesnoth
            Submitted by: exasperation
            Submitted on: Sun 03 Jul 2011 03:17:28 PM EDT
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Adds a new function, wesnoth.set_dialog_active, which allows widgets to be
set to active or inactive.  First argument is a boolean specifying whether the
widget should be activated (true) or deactivated (false).  Remaining arguments
describe the path for reaching the widget.

Test case:

local T = helper.set_wml_tag_metatable {}
wesnoth.synchronize_choice(function()
        local dialog = {
                T.tooltip { id = "tooltip_large" },
                T.helptip { id = "tooltip_large" },
                T.grid {
                        T.row { T.column {
                                T.toggle_button { id = "test_toggle", label = 
"Active" }
                        } },
                        T.row { T.column {
                                T.button { id = "ok", label = "OK" }
                        } }
                }
        }
        local function preshow()
                local function toggle_active()
                        
wesnoth.set_dialog_active(wesnoth.get_dialog_value("test_toggle"), "ok")
                end
                wesnoth.set_dialog_callback(toggle_active, "test_toggle")
                toggle_active()
        end
        wesnoth.show_dialog(dialog, preshow)
end)


Documentation should go under http://wiki.wesnoth.org/LuaWML#User_interface



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 03 Jul 2011 03:17:28 PM EDT  Name: lua_gui_set_active.patch  Size:
2kB   By: exasperation

<http://gna.org/patch/download.php?file_id=13454>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?2767>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to