나는 monodevelop/C#/gdk를 조금 실험하고 있는데, 노출 이벤트를 올바르게 처리하고있는 DrawingArea
을 가진 윈도우를 만들 수 있었다.왜`ButtonPressEvent`가 나오지 않는가
그러나 마우스 다운 이벤트는 발송되지 않으며 이유를 이해할 수 없습니다. 대표단은 GUI 디자이너에 의해 자동 생성 코드에서 설정 한 :
this.da.ExposeEvent += new global::Gtk.ExposeEventHandler (this.OnDAExposeEvent);
this.da.ButtonPressEvent += new global::Gtk.ButtonPressEventHandler (this.OnDAButtonPressEvent);
this.da.MotionNotifyEvent += new global::Gtk.MotionNotifyEventHandler (this.OnDAMotionNotifyEvent);
이 내 초기화 코드 :
public MainWindow() : base (Gtk.WindowType.Toplevel)
{
Build();
Gdk.Color col = new Gdk.Color();
col.Red = col.Green = col.Blue = 0x8888;
da.ModifyBg(StateType.Normal, col);
var p = "wr/wn/wb/wq/wk/wp/br/bn/bb/bq/bk/bp".Split ('/');
for (int i = 0; i < p.Length; i++) {
pieces[p[i]] = new ImageSurface("/home/agriffini/x/chessboard/i" + p [i] + ".png");
}
da.Events |= (Gdk.EventMask.ButtonPressMask
| Gdk.EventMask.ButtonReleaseMask
| Gdk.EventMask.KeyPressMask
| Gdk.EventMask.PointerMotionMask);
}
라는 결코 극복 핸들러 함수 OnDAButtonPressEvent
이 (중단 점을 배치하여 확인하지만 그곳에).
누락 된 부분은 무엇입니까?