Ignore:
Timestamp:
05/05/16 19:37:28 (9 years ago)
Author:
epyon
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/gui_environment.cc

    r444 r492  
    182182                {
    183183                        handle h = get_element( position( ev.mbutton.x, ev.mbutton.y ) );
     184                        element* e = m_elements.get( h );
     185                        if ( e->m_on_click ) e->m_on_click();
     186
    184187                        set_selected( h );
    185188                        return true;
     
    312315}
    313316
     317void nv::gui::environment::set_on_click( handle e, const function< void() >& on_click )
     318{
     319        element* ep = m_elements.get( e );
     320        if ( ep != nullptr )
     321        {
     322                ep->m_on_click = on_click;
     323        }
     324}
     325
    314326void nv::gui::environment::set_text( handle e, const string_twine& text )
    315327{
Note: See TracChangeset for help on using the changeset viewer.