sample: Update TestDnd and add it to the build

This commit is contained in:
Bertrand Lorentz 2011-07-02 11:35:55 +02:00
parent ebc40cd400
commit c9a8500eac
2 changed files with 9 additions and 10 deletions

View file

@ -8,7 +8,7 @@ DOTNET_TARGETS=
DOTNET_ASSEMBLY=
endif
TARGETS = gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe treeviewdemo.exe managedtreeviewdemo.exe nodeviewdemo.exe treemodeldemo.exe actions.exe spawn.exe assistant.exe registerprop.exe gexceptiontest.exe native-instantiation.exe polarfixed.exe cairo-sample.exe scribble.exe # custom-widget.exe custom-cellrenderer.exe scribble-xinput.exe testdnd.exe $(DOTNET_TARGETS)
TARGETS = gtk-hello-world.exe button.exe calendar.exe subclass.exe menu.exe treeviewdemo.exe managedtreeviewdemo.exe nodeviewdemo.exe treemodeldemo.exe actions.exe spawn.exe assistant.exe registerprop.exe gexceptiontest.exe native-instantiation.exe polarfixed.exe cairo-sample.exe scribble.exe testdnd.exe #custom-widget.exe custom-cellrenderer.exe scribble-xinput.exe $(DOTNET_TARGETS)
DEBUGS = $(addsuffix .mdb, $(TARGETS))

View file

@ -290,7 +290,7 @@ public class TestDnd {
have_drag = false;
// FIXME? Kinda wonky binding.
(sender as Gtk.Image).FromPixbuf = trashcan_closed_pixbuf;
(sender as Gtk.Image).Pixbuf = trashcan_closed_pixbuf;
}
private static void HandleTargetDragMotion (object sender, DragMotionArgs args)
@ -298,13 +298,13 @@ public class TestDnd {
if (! have_drag) {
have_drag = true;
// FIXME? Kinda wonky binding.
(sender as Gtk.Image).FromPixbuf = trashcan_open_pixbuf;
(sender as Gtk.Image).Pixbuf = trashcan_open_pixbuf;
}
Widget source_widget = Gtk.Drag.GetSourceWidget (args.Context);
Console.WriteLine ("motion, source {0}", source_widget == null ? "null" : source_widget.ToString ());
Atom [] targets = args.Context.Targets;
Atom [] targets = args.Context.ListTargets ();
foreach (Atom a in targets)
Console.WriteLine (a.Name);
@ -316,7 +316,7 @@ public class TestDnd {
{
Console.WriteLine ("drop");
have_drag = false;
(sender as Gtk.Image).FromPixbuf = trashcan_closed_pixbuf;
(sender as Gtk.Image).Pixbuf = trashcan_closed_pixbuf;
#if BROKEN // Context.Targets is not defined in the bindings
if (Context.Targets.Length != 0) {
@ -474,7 +474,7 @@ public class TestDnd {
Button button;
Pixbuf drag_icon_pixbuf;
Application.Init ();
Gtk.Application.Init ();
window = new Gtk.Window (Gtk.WindowType.Toplevel);
window.DeleteEvent += new DeleteEventHandler (OnDelete);
@ -522,8 +522,7 @@ public class TestDnd {
Gtk.Drag.SourceSet (button, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
target_table, DragAction.Copy | DragAction.Move);
// FIXME can I pass a pixbuf here instead?
// Gtk.Drag.SourceSetIcon (button, window.Colormap, drag_icon, drag_mask);
Gtk.Drag.SourceSetIconPixbuf (button, drag_icon_pixbuf);
table.Attach (button, 0, 1, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
@ -534,11 +533,11 @@ public class TestDnd {
window.ShowAll ();
Application.Run ();
Gtk.Application.Run ();
}
private static void OnDelete (object o, DeleteEventArgs e)
{
Application.Quit ();
Gtk.Application.Quit ();
}
}