Changes between Version 5 and Version 6 of UI
- Timestamp:
- 09/02/14 04:06:50 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UI
v5 v6 33 33 }}} 34 34 35 {{{ 35 {{{#!lua 36 36 -- some_script.lua 37 37 38 ui_element = ui.create( "mywindow" ); 39 local result 40 ui_element:find("yes").on_click = function(self) result = true; self:destroy() end 41 ui_element:find("no").on_click = function(self) result = false; self:destroy() end 42 ui:run_modal( ui_element ) 38 function run_mywindow() 39 ui_element = ui.create( "mywindow" ); 40 ui_element:find("yes").on_click = function(self) self:destroy(true) end 41 ui_element:find("no").on_click = function(self) self:destroy(false) end 42 return ui.run_modal( ui_element ) 43 end 44 }}} 43 45 46 {{{#!cpp 47 // C++ invocation 48 bool result = lua->call<bool>("run_mywindow"); 44 49 }}} 45 50 … … 51 56 Each UI element has: 52 57 * id value, might not be set 53 * type value, set by type database54 58 * class value, might be set by user 55 59 * special modifier (selected, hover, etc)