Chinaunix首页 | 论坛 | 博客
  • 博客访问: 448102
  • 博文数量: 88
  • 博客积分: 2677
  • 博客等级: 少校
  • 技术积分: 893
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-13 08:01
文章分类

全部博文(88)

文章存档

2017年(3)

2016年(1)

2012年(4)

2011年(4)

2010年(57)

2009年(19)

我的朋友

分类: LINUX

2010-02-04 16:28:13


为了理解不同状态动作时,信号事件的先后关系和关联关系。

建立了一个window后,通过glade把
  • GtkContainer
  • GtkWidget
  • GtkObject
  • GObject
这四类的信号事件全部连接的回调函数。
并在回调函数中g_print标识,以便理解。

至于其他的widget的信号,均未连接例如:
  • GtkTextView
  • GtkStatusBar
  • GtkButton
  • 等等,等等,等等
注:---
gtk_builder_connect_signals (builder, NULL);
可以自动连接好,glade中设置了的所有的信号和回调函数。
-------

本文仅为备份,这些仅g_print标识的回调函数,以便以后学习使用时能快速copy。


#ifndef _BASE_H_
#define _BASE_H_



/*
g_print ("\n");
  //return TRUE;
  //return FALSE;
  */
/* ---GtkWindow--------------------------------------------------------------------------------------------- */
void
on_window_activate_default (GtkWindow        *window,
                            gpointer user_data){
    g_print ("GtkWindow:on_window_activate_default\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_activate_focus (GtkWindow        *window,
                         gpointer user_data){
    g_print ("GtkWindow:on_window_activate_focus\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_frame_event (GtkWindow        *window,
                     GdkEvent *event,
                     gpointer user_data){
    g_print ("GtkWindow:on_window_frame_event\n");
    //return TRUE;

    return FALSE;
}
void
on_window_keys_changed (GtkWindow        *window,
                        gpointer user_data){
    g_print ("GtkWindow:on_window_keys_changed\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_set_focus (GtkWindow        *window,
                     GtkWidget *widget,
                     gpointer user_data){
    g_print ("GtkWindow:on_window_set_focus\n");
    //return TRUE;

    //return FALSE;

}
/* ---GtkContainer--------------------------------------------------------------------------------------------- */
void
on_window_add (GtkContainer *container,
             GtkWidget *widget,
             gpointer user_data){
    g_print ("GtkContainer:on_window_add\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_check_resize (GtkContainer *container,
                        gpointer user_data){
    g_print ("GtkContainer:on_window_check_resize\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_remove (GtkContainer *container,
                 GtkWidget *widget,
                 gpointer user_data){
    g_print ("GtkContainer:on_window_remove\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_set_focus_child (GtkContainer *container,
                         GtkWidget *widget,
                         gpointer user_data){
    g_print ("GtkContainer:on_window_set_focus_child\n");
    //return TRUE;

    //return FALSE;

}
/* ---GtkWidget--------------------------------------------------------------------------------------------- */
void
on_window_accel_closures_changed (GtkWidget *widget, gpointer user_data){
    g_print ("on_window_accel_closures_changed\n");
}
gboolean
on_window_button_press_event (GtkWidget            *widget,
                             GdkEventButton    *event,
                             gpointer user_data){
    g_print ("on_window_button_press_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_button_release_event (GtkWidget *widget,
                                GdkEventButton *event,
                                gpointer user_data){
    g_print ("on_window_button_release_even\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_can_activate_accel (GtkWidget *widget,
                             guint signal_id,
                             gpointer user_data){
    g_print ("on_window_can_activate_accel\n");
    //return TRUE;

    return FALSE;
}
void
on_window_child_notify (GtkWidget *widget,
                        GParamSpec *pspec,
                        gpointer user_data){
    g_print ("on_window_child_notify\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_client_event (GtkWidget *widget,
                        GdkEventClient *event,
                        gpointer user_data){
    g_print ("on_window_client_event\n");
    //return TRUE;

    return FALSE;
}
void
on_window_composited_changed (GtkWidget        *widget,
                             gpointer user_data){
    g_print ("on_window_composited_changed\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_configure_event (GtkWidget *widget,
                         GdkEventConfigure        *event,
                         gpointer                 user_data){
    g_print ("on_window_configure_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_damage_event (GtkWidget        *widget,
                        GdkEvent *event,
                        gpointer user_data){
    g_print ("on_window_damage_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_delete_event (GtkWidget        *widget,
                        GdkEvent *event,
                        gpointer user_data){
    g_print ("on_window_delete_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_destroy_event (GtkWidget        *widget,
                         GdkEvent *event,
                         gpointer user_data){
    g_print ("on_window_destroy_event\n");
    //return TRUE;

    return FALSE;
}
void
on_window_direction_changed (GtkWidget *widget,
                             GtkTextDirection previous_direction,
                             gpointer user_data){
    g_print ("on_window_direction_changed\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_drag_begin (GtkWidget *widget,
                     GdkDragContext *drag_context,
                     gpointer user_data){
    g_print ("on_window_drag_begin\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_drag_data_delete (GtkWidget *widget,
                            GdkDragContext *drag_context,
                            gpointer user_data){
    g_print ("on_window_drag_data_delete\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_drag_data_get (GtkWidget *widget,
                         GdkDragContext *drag_context,
                         GtkSelectionData *data,
                         guint info,
                         guint time,
                         gpointer user_data) {
    g_print ("on_window_drag_data_get\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_drag_data_received (GtkWidget *widget,
                             GdkDragContext *drag_context,
                             gint x,
                             gint y,
                             GtkSelectionData *data,
                             guint info,
                             guint time,
                             gpointer user_data){
    g_print ("on_window_drag_data_received\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_drag_drop (GtkWidget *widget,
                     GdkDragContext *drag_context,
                     gint x,
                     gint y,
                     guint time,
                     gpointer user_data){
    g_print ("on_window_drag_drop\n");
    //return TRUE;

    return FALSE;
}
void
on_window_drag_end (GtkWidget *widget,
                    GdkDragContext *drag_context,
                    gpointer user_data){
    g_print ("on_window_drag_end\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_drag_failed (GtkWidget *widget,
                     GdkDragContext *drag_context,
                     GtkDragResult result,
                     gpointer user_data){
    g_print ("on_window_drag_failed\n");
    //return TRUE;

    return FALSE;
}
void
on_window_drag_leave (GtkWidget *widget,
                     GdkDragContext *drag_context,
                     guint time,
                     gpointer user_data){
    g_print ("on_window_drag_leave\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_drag_motion (GtkWidget *widget,
                     GdkDragContext *drag_context,
                     gint x,
                     gint y,
                     guint time,
                     gpointer user_data){
    g_print ("on_window_drag_motion\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_enter_notify_event (GtkWidget *widget,
                             GdkEventCrossing *event,
                             gpointer user_data){
    g_print ("on_window_enter_notify_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_event (GtkWidget *widget,
                 GdkEvent *event,
                 gpointer user_data){
    g_print ("on_window_event\n");
    //return TRUE;

    return FALSE;
}
void
on_window_event_after (GtkWidget *widget,
                     GdkEvent *event,
                     gpointer user_data){
    g_print ("on_window_event_after\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_expose_event (GtkWidget *widget,
                        GdkEventExpose *event,
                        gpointer user_data){
    g_print ("on_window_expose_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_focus (GtkWidget *widget,
                 GtkDirectionType arg1,
                 gpointer user_data){
    g_print ("on_window_focus\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_focus_in_event (GtkWidget *widget,
                         GdkEventFocus *event,
                         gpointer user_data){
    g_print ("on_window_focus_in_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_focus_out_event (GtkWidget *widget,
                         GdkEventFocus *event,
                         gpointer user_data){
    g_print ("on_window_focus_out_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_grab_broken_event (GtkWidget *widget,
                             GdkEvent *event,
                             gpointer user_data){
    g_print ("on_window_grab_broken_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_grab_focus (GtkWidget *widget,
                     gpointer user_data){
    g_print ("on_window_grab_focus\n");
    //return TRUE;

    //return FALSE;    

}
void
on_window_grab_notify (GtkWidget *widget,
                     gboolean was_grabbed,
                     gpointer user_data){
    g_print ("on_window_grab_notify\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_hide (GtkWidget *widget,
                gpointer user_data){
    g_print ("on_window_hide\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_hierarchy_changed (GtkWidget *widget,
                             GtkWidget *previous_toplevel,
                             gpointer user_data){
    g_print ("on_window_hierarchy_changed\n");
    //return TRUE;

    //return FALSE;

}
gboolean
on_window_key_press_event (GtkWidget *widget,
                         GdkEventKey *event,
                         gpointer user_data){
    g_print ("on_window_key_press_event\n");
    //return TRUE;

    return FALSE;
}
gboolean
on_window_key_release_event (GtkWidget *widget,
                             GdkEventKey *event,
                             gpointer user_data){
    g_print ("on_window_key_release_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_keynav_failed (GtkWidget *widget,
                         GtkDirectionType direction,
                         gpointer user_data){
    g_print ("on_window_keynav_failed\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_leave_notify_event (GtkWidget *widget,
                             GdkEventCrossing *event,
                             gpointer user_data){
    g_print ("on_window_leave_notify_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_map (GtkWidget *widget,
             gpointer user_data){
    g_print ("on_window_map\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_map_event (GtkWidget *widget,
                     GdkEvent *event,
                     gpointer user_data){
    g_print ("on_window_map_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_mnemonic_activate (GtkWidget *widget,
                             gboolean arg1,
                             gpointer user_data){
    g_print ("on_window_mnemonic_activate\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_motion_notify_event (GtkWidget *widget,
                             GdkEventMotion *event,
                             gpointer user_data){
    g_print ("on_window_motion_notify_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_move_focus (GtkWidget *widget,
                     GtkDirectionType arg1,
                     gpointer user_data){
    g_print ("on_window_move_focus\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_no_expose_event (GtkWidget *widget,
                         GdkEventNoExpose *event,
                         gpointer user_data){
    g_print ("on_window_no_expose_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_parent_set (GtkWidget *widget,
                     GtkObject *old_parent,
                     gpointer user_data){
    g_print ("on_window_parent_set\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_popup_menu (GtkWidget *widget,
                     gpointer user_data){
    g_print ("on_window_popup_menu\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_property_notify_event (GtkWidget *widget,
                                 GdkEventProperty *event,
                                 gpointer user_data){
    g_print ("on_window_property_notify_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_proximity_in_event (GtkWidget *widget,
                             GdkEventProximity *event,
                             gpointer user_data){
    g_print ("on_window_proximity_in_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_proximity_out_event (GtkWidget *widget,
                             GdkEventProximity *event,
                             gpointer user_data){
    g_print ("on_window_proximity_out_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_query_tooltip (GtkWidget *widget,
                         gint x,
                         gint y,
                         gboolean keyboard_mode,
                         GtkTooltip *tooltip,
                         gpointer user_data) {
    g_print ("on_window_query_tooltip\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_realize (GtkWidget *widget,
                 gpointer user_data){
    g_print ("on_window_realize\n");
    //return TRUE;

    //return FALSE;

}
void
on_window_screen_changed (GtkWidget *widget,
                         GdkScreen *previous_screen,
                         gpointer user_data){
    g_print ("on_window_screen_changed\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_scroll_event (GtkWidget *widget,
                        GdkEventScroll *event,
                        gpointer user_data){
    g_print ("on_window_scroll_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_selection_clear_event (GtkWidget *widget,
                                 GdkEventSelection *event,
                                 gpointer user_data){
    g_print ("on_window_selection_clear_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_selection_get (GtkWidget *widget,
                         GtkSelectionData *data,
                         guint info,
                         guint time,
                         gpointer user_data){
    g_print ("on_window_selection_get\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_selection_notify_event (GtkWidget *widget,
                                 GdkEventSelection *event,
                                 gpointer user_data){
    g_print ("on_window_selection_notify_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_selection_received (GtkWidget *widget,
                             GtkSelectionData *data,
                             guint time,
                             gpointer user_data){
    g_print ("on_window_selection_received\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_selection_request_event (GtkWidget *widget,
                                 GdkEventSelection *event,
                                 gpointer user_data){
    g_print ("on_window_selection_request_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_show (GtkWidget *widget,
                gpointer user_data){
    g_print ("on_window_show\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_show_help (GtkWidget *widget,
                     GtkWidgetHelpType arg1,
                     gpointer user_data){
    g_print ("on_window_show_help\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_size_allocate (GtkWidget *widget,
                         GtkAllocation *allocation,
                         gpointer user_data){
    g_print ("on_window_size_allocate\n");
    //return TRUE;

    //return FALSE;    

}
void
on_window_size_request (GtkWidget *widget,
                        GtkRequisition *requisition,
                        gpointer user_data){
    g_print ("on_window_size_request\n");
    //return TRUE;

    //return FALSE;    

}
void
on_window_state_changed (GtkWidget *widget,
                         GtkStateType state,
                         gpointer user_data){
    g_print ("on_window_state_changed\n");
    //return TRUE;

    //return FALSE;    

}
void
on_window_style_set (GtkWidget *widget,
                     GtkStyle *previous_style,
                     gpointer user_data){
    g_print ("on_window_style_set\n");
    //return TRUE;

    //return FALSE;    

}
void
on_window_unmap (GtkWidget *widget,
                 gpointer user_data){
    g_print ("on_window_unmap\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_unmap_event (GtkWidget *widget,
                     GdkEvent *event,
                     gpointer user_data){
    g_print ("on_window_unmap_event\n");
    //return TRUE;

    return FALSE;    
}
void
on_window_unrealize (GtkWidget *widget,
                     gpointer user_data){
    g_print ("on_window_unrealize\n");
    //return TRUE;

    //return FALSE;    

}
gboolean
on_window_visibility_notify_event (GtkWidget *widget,
                                 GdkEventVisibility *event,
                                 gpointer user_data){
    g_print ("on_window_visibility_notify_event\n");
    //return TRUE;

    return FALSE;    
}
gboolean
on_window_window_state_event (GtkWidget *widget,
                             GdkEventWindowState *event,
                             gpointer user_data){
    g_print ("on_window_window_state_event\n");
    //return TRUE;

    return FALSE;    
}
/* ---GtkObject-------------------------------------------------------------------------------------- */
void
on_window_destroy(GtkObject *object, gpointer user_date)
{
    g_print ("GtkObject:on_window_destroy\n");
    gtk_main_quit();
}
/* ---GObject-------------------------------------------------------------------------------------- */
void
on_window_notify (GObject        *gobject,
                 GParamSpec *pspec,
                 gpointer user_data){
    g_print ("GObject:on_window_notify\n");
    //return TRUE;

    //return FALSE;

}
/* ----------------------------------------------------------------------------------------- */


#endif /* _BASE_H_ */





阅读(1542) | 评论(0) | 转发(0) |
0

上一篇:gcc 编译步骤

下一篇:指针 备忘 随笔

给主人留下些什么吧!~~