moo_window_set_edit_ops_widget()

master
Yevgen Muntyan 2008-05-23 17:45:31 -05:00
parent 7085338d7c
commit 0eee8ec5f3
2 changed files with 24 additions and 0 deletions

View File

@ -1965,6 +1965,28 @@ _moo_window_class_new_action_callback (MooWindowClass *klass,
/* MooEditOps /* MooEditOps
*/ */
void
moo_window_set_edit_ops_widget (MooWindow *window,
GtkWidget *widget)
{
g_return_if_fail (MOO_IS_WINDOW (window));
g_return_if_fail (!widget || GTK_IS_WIDGET (widget));
if (widget == window->priv->default_eo_widget)
return;
if (widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
g_return_if_fail (toplevel == GTK_WIDGET (window));
g_return_if_fail (_moo_edit_ops_check (widget));
}
/* XXX remove it when it's removed from the window or destroyed */
window->priv->default_eo_widget = widget;
}
static void static void
moo_window_action_cut (MooWindow *window) moo_window_action_cut (MooWindow *window)
{ {

View File

@ -64,6 +64,8 @@ GType moo_window_get_type (void) G_GNUC_CONST;
gboolean moo_window_close (MooWindow *window); gboolean moo_window_close (MooWindow *window);
void moo_window_apply_prefs (MooWindow *window); void moo_window_apply_prefs (MooWindow *window);
void moo_window_set_edit_ops_widget (MooWindow *window,
GtkWidget *widget);
/*****************************************************************************/ /*****************************************************************************/
/* Actions /* Actions