sample: Update TestDnd and add it to the build
This commit is contained in:
parent
ebc40cd400
commit
c9a8500eac
2 changed files with 9 additions and 10 deletions
|
@ -8,7 +8,7 @@ DOTNET_TARGETS=
|
||||||
DOTNET_ASSEMBLY=
|
DOTNET_ASSEMBLY=
|
||||||
endif
|
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))
|
DEBUGS = $(addsuffix .mdb, $(TARGETS))
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ public class TestDnd {
|
||||||
have_drag = false;
|
have_drag = false;
|
||||||
|
|
||||||
// FIXME? Kinda wonky binding.
|
// 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)
|
private static void HandleTargetDragMotion (object sender, DragMotionArgs args)
|
||||||
|
@ -298,13 +298,13 @@ public class TestDnd {
|
||||||
if (! have_drag) {
|
if (! have_drag) {
|
||||||
have_drag = true;
|
have_drag = true;
|
||||||
// FIXME? Kinda wonky binding.
|
// 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);
|
Widget source_widget = Gtk.Drag.GetSourceWidget (args.Context);
|
||||||
Console.WriteLine ("motion, source {0}", source_widget == null ? "null" : source_widget.ToString ());
|
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)
|
foreach (Atom a in targets)
|
||||||
Console.WriteLine (a.Name);
|
Console.WriteLine (a.Name);
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ public class TestDnd {
|
||||||
{
|
{
|
||||||
Console.WriteLine ("drop");
|
Console.WriteLine ("drop");
|
||||||
have_drag = false;
|
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 BROKEN // Context.Targets is not defined in the bindings
|
||||||
if (Context.Targets.Length != 0) {
|
if (Context.Targets.Length != 0) {
|
||||||
|
@ -474,7 +474,7 @@ public class TestDnd {
|
||||||
Button button;
|
Button button;
|
||||||
Pixbuf drag_icon_pixbuf;
|
Pixbuf drag_icon_pixbuf;
|
||||||
|
|
||||||
Application.Init ();
|
Gtk.Application.Init ();
|
||||||
|
|
||||||
window = new Gtk.Window (Gtk.WindowType.Toplevel);
|
window = new Gtk.Window (Gtk.WindowType.Toplevel);
|
||||||
window.DeleteEvent += new DeleteEventHandler (OnDelete);
|
window.DeleteEvent += new DeleteEventHandler (OnDelete);
|
||||||
|
@ -522,8 +522,7 @@ public class TestDnd {
|
||||||
Gtk.Drag.SourceSet (button, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
|
Gtk.Drag.SourceSet (button, Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
|
||||||
target_table, DragAction.Copy | DragAction.Move);
|
target_table, DragAction.Copy | DragAction.Move);
|
||||||
|
|
||||||
// FIXME can I pass a pixbuf here instead?
|
Gtk.Drag.SourceSetIconPixbuf (button, drag_icon_pixbuf);
|
||||||
// Gtk.Drag.SourceSetIcon (button, window.Colormap, drag_icon, drag_mask);
|
|
||||||
|
|
||||||
table.Attach (button, 0, 1, 1, 2,
|
table.Attach (button, 0, 1, 1, 2,
|
||||||
AttachOptions.Expand | AttachOptions.Fill,
|
AttachOptions.Expand | AttachOptions.Fill,
|
||||||
|
@ -534,11 +533,11 @@ public class TestDnd {
|
||||||
|
|
||||||
window.ShowAll ();
|
window.ShowAll ();
|
||||||
|
|
||||||
Application.Run ();
|
Gtk.Application.Run ();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnDelete (object o, DeleteEventArgs e)
|
private static void OnDelete (object o, DeleteEventArgs e)
|
||||||
{
|
{
|
||||||
Application.Quit ();
|
Gtk.Application.Quit ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue