- 论坛徽章:
- 0
|
- typedef struct {
- int x, y;
- } pos_t;
- typedef struct {
- pos_t pos;
- int press_button[3];
- struct timeval;
- }message_t;
- typedef void (*act_f) (void);
- typedef struct {
- int id;
- pos_t pos;
- int width;
- int height;
- struct button_t *button[10];
- void (*load_bg)(void *);
- } windows_t;
- typedef struct button_t{
- int id;
- pos_t pos;
- char *name;
- act_f (*respond)(windows_t cur_win, message_t msg_mouse);
- act_f inside_do;
- act_f press_left_do;
- act_f press_right_do;
- } button_t;
复制代码 要用C语言(不使用其他库)实现 按钮的点击 响应事件, 我第一次弄,自己按照对windows消息机制的理解,定义了上述 结构体;
结果是windows_t 里要用到 button_t , 而button_t 里要用到windows_t; 不知如何解决了;
那位能给个鼠标点击按钮,然后响应 事件的 简单策略,我的这个异常复杂; |
|