mirror of
https://github.com/nishiowo/nishbox
synced 2025-04-21 12:14:39 +00:00
input (kinda) works, close #7
This commit is contained in:
parent
6095b0ec62
commit
ae3d005671
@ -82,7 +82,7 @@ gf_gui_id_t button1 = -1;
|
||||
gf_gui_id_t button2 = -1;
|
||||
|
||||
void gf_button_callback(gf_engine_t* engine, gf_draw_t* draw, gf_gui_id_t id, int type) {
|
||||
if(type == GF_GUI_PRESS) {
|
||||
if(type == GF_GUI_PRESS_EVENT) {
|
||||
gf_log_function(engine, "GUI component %d was pressed", id);
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ void gf_gui_render(gf_gui_t* gui) {
|
||||
}
|
||||
if((gui->pressed != -1) && !(input->mouse_flag & GF_INPUT_MOUSE_LEFT_MASK)) {
|
||||
if(gui->area[gui->pressed].callback != NULL) {
|
||||
gui->area[gui->pressed].callback(gui->engine, gui->draw, gui->pressed, GF_GUI_PRESS);
|
||||
gui->area[gui->pressed].callback(gui->engine, gui->draw, gui->pressed, GF_GUI_PRESS_EVENT);
|
||||
}
|
||||
gui->area[gui->pressed].pressed = 1;
|
||||
gui->pressed = -1;
|
||||
|
@ -21,7 +21,7 @@ typedef int gf_gui_id_t;
|
||||
* @brief GUI events
|
||||
*/
|
||||
enum GF_GUI_EVENTS {
|
||||
GF_GUI_PRESS = 0
|
||||
GF_GUI_PRESS_EVENT = 0
|
||||
};
|
||||
|
||||
#ifdef GF_EXPOSE_GUI
|
||||
|
Loading…
x
Reference in New Issue
Block a user