| 39 GntWidgetClass *wid_class = GNT_WIDGET_CLASS(klass); |
43 GntWidgetClass *wid_class = GNT_WIDGET_CLASS(klass); |
| 40 parent_class = GNT_BOX_CLASS(klass); |
44 parent_class = GNT_BOX_CLASS(klass); |
| 41 |
45 |
| 42 org_destroy = wid_class->destroy; |
46 org_destroy = wid_class->destroy; |
| 43 wid_class->destroy = gnt_window_destroy; |
47 wid_class->destroy = gnt_window_destroy; |
| |
48 |
| |
49 signals[SIG_WORKSPACE_HIDE] = |
| |
50 g_signal_new("workspace-hidden", |
| |
51 G_TYPE_FROM_CLASS(klass), |
| |
52 G_SIGNAL_RUN_LAST, |
| |
53 0, |
| |
54 NULL, NULL, |
| |
55 g_cclosure_marshal_VOID__VOID, |
| |
56 G_TYPE_NONE, 0); |
| |
57 |
| |
58 signals[SIG_WORKSPACE_SHOW] = |
| |
59 g_signal_new("workspace-shown", |
| |
60 G_TYPE_FROM_CLASS(klass), |
| |
61 G_SIGNAL_RUN_LAST, |
| |
62 0, |
| |
63 NULL, NULL, |
| |
64 g_cclosure_marshal_VOID__VOID, |
| |
65 G_TYPE_NONE, 0); |
| 44 |
66 |
| 45 gnt_bindable_class_register_action(bindable, "show-menu", show_menu, |
67 gnt_bindable_class_register_action(bindable, "show-menu", show_menu, |
| 46 GNT_KEY_CTRL_O, NULL); |
68 GNT_KEY_CTRL_O, NULL); |
| 47 gnt_bindable_register_binding(bindable, "show-menu", GNT_KEY_F10, NULL); |
69 gnt_bindable_register_binding(bindable, "show-menu", GNT_KEY_F10, NULL); |
| 48 gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), bindable); |
70 gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), bindable); |
| 107 box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID; |
129 box->alignment = vert ? GNT_ALIGN_LEFT : GNT_ALIGN_MID; |
| 108 |
130 |
| 109 return wid; |
131 return wid; |
| 110 } |
132 } |
| 111 |
133 |
| |
134 void |
| |
135 gnt_window_workspace_hiding(GntWindow *window) |
| |
136 { |
| |
137 if (window->menu) |
| |
138 gnt_widget_hide(GNT_WIDGET(window->menu)); |
| |
139 g_signal_emit(window, signals[SIG_WORKSPACE_HIDE], 0); |
| |
140 } |
| |
141 |
| |
142 void |
| |
143 gnt_window_workspace_showing(GntWindow *window) |
| |
144 { |
| |
145 g_signal_emit(window, signals[SIG_WORKSPACE_SHOW], 0); |
| |
146 } |
| |
147 |
| 112 void gnt_window_set_menu(GntWindow *window, GntMenu *menu) |
148 void gnt_window_set_menu(GntWindow *window, GntMenu *menu) |
| 113 { |
149 { |
| 114 /* If a menu already existed, then destroy that first. */ |
150 /* If a menu already existed, then destroy that first. */ |
| 115 if (window->menu) |
151 if (window->menu) |
| 116 gnt_widget_destroy(GNT_WIDGET(window->menu)); |
152 gnt_widget_destroy(GNT_WIDGET(window->menu)); |