~ubuntu-branches/ubuntu/karmic/mhwaveedit/karmic

« back to all changes in this revision

Viewing changes to src/combo.c

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2008-01-08 22:20:37 UTC
  • mfrom: (2.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080108222037-tsazhckl5vmc8yih
Tags: 1.4.14-2
Added desktop file (Closes: #457849), thanks to Marco Rodrigues

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2004, Magnus Hjorth
 
2
 * Copyright (C) 2004 2006, Magnus Hjorth
3
3
 *
4
4
 * This file is part of mhWaveEdit.
5
5
 *
52
52
     gtk_signal_emit(GTK_OBJECT(combo),combo_signals[CHANGED_SIGNAL]);
53
53
}
54
54
 
 
55
static gboolean list_motion_notify(GtkWidget *widget, GdkEventMotion *event,
 
56
                                   gpointer user_data)
 
57
{
 
58
     gint mx,my;
 
59
     gint wx,wy,ww,wh;
 
60
     
 
61
     gdk_window_get_root_origin(widget->window,&wx,&wy);
 
62
     gdk_window_get_size(widget->window,&ww,&wh);
 
63
     mx = (gint) (event->x_root);
 
64
     my = (gint) (event->y_root);
 
65
 
 
66
     /*printf("mouse: <%d,%d>, window: <%d,%d>+<%d,%d>\n",mx,my,wx,wy,ww,wh);*/
 
67
     if (mx < wx || mx > wx+ww || my < wy || my > wy+wh)
 
68
          gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
 
69
                                       "motion-notify-event");
 
70
     return FALSE;
 
71
}
 
72
 
55
73
static void combo_init(GtkObject *obj)
56
74
{
57
75
     GtkCombo *cbo = GTK_COMBO(obj);
59
77
     gtk_editable_set_editable(GTK_EDITABLE(cbo->entry),FALSE);     
60
78
     gtk_signal_connect(GTK_OBJECT(cbo->list),"select_child",list_select_child,
61
79
                        obj);
 
80
     gtk_signal_connect(GTK_OBJECT(cbo->list),"motion-notify-event",
 
81
                        GTK_SIGNAL_FUNC(list_motion_notify),obj);
62
82
}
63
83
 
64
84
void combo_set_items(Combo *combo, GList *item_strings, int default_index)