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

                 Summary: Adds support for button widget to
wesnoth.set_dialog_callback
                 Project: Battle for Wesnoth
            Submitted by: exasperation
            Submitted on: Tue 28 Jun 2011 03:29:34 PM EDT
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This patch adds support for the button widget to wesnoth.set_dialog_callback

Test case:

local T = helper.set_wml_tag_metatable {}
wesnoth.synchronize_choice(function()
        local message_state = 0
        local dialog = {
                T.tooltip { id = "tooltip_large" },
                T.helptip { id = "tooltip_large" },
                T.grid {
                        T.row { T.column {
                                T.label { id = "test_label", label = 
"Testing..." }
                        } },
                        T.row { T.column {
                                T.button { id = "test_button", label = "Test", 
return_value = 0 }
                        } },
                        T.row { T.column {
                                T.button { id = "ok", label = "OK" }
                        } }
                }
        }
        local function preshow()
                local function change_label()
                        if message_state == 0 then
                                wesnoth.set_dialog_value("Success!", 
"test_label")
                                message_state = 1
                        else
                                wesnoth.set_dialog_value("Testing...", 
"test_label")
                                message_state = 0
                        end
                end
                wesnoth.set_dialog_callback(change_label, "test_button")
        end
        wesnoth.show_dialog(dialog, preshow)
end)




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 28 Jun 2011 03:29:35 PM EDT  Name: lua_gui_button_callback.patch 
Size: 1kB   By: exasperation

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

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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