mail-archives/gtk-sharp-list/2013-August/011285.html

88 строки
4.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] GTK# hscale, porting from a winforms application
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=Re%3A%20%5BGtk-sharp-list%5D%20GTK%23%20hscale%2C%0A%09porting%20from%20a%20winforms%20application&In-Reply-To=%3CCAFSJrsnYx9csHTeZYqyKE3YU3dpVir8YSxkdbrO5E-gaOTm0SA%40mail.gmail.com%3E">
<META NAME="robots" CONTENT="index,nofollow">
<style type="text/css">
pre {
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
}
</style>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="011284.html">
<LINK REL="Next" HREF="011286.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] GTK# hscale, porting from a winforms application</H1>
<B>Bertrand Lorentz</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=Re%3A%20%5BGtk-sharp-list%5D%20GTK%23%20hscale%2C%0A%09porting%20from%20a%20winforms%20application&In-Reply-To=%3CCAFSJrsnYx9csHTeZYqyKE3YU3dpVir8YSxkdbrO5E-gaOTm0SA%40mail.gmail.com%3E"
TITLE="[Gtk-sharp-list] GTK# hscale, porting from a winforms application">bertrand.lorentz at gmail.com
</A><BR>
<I>Tue Aug 27 13:45:15 UTC 2013</I>
<P><UL>
<LI>Previous message: <A HREF="011284.html">[Gtk-sharp-list] GTK# hscale, porting from a winforms application
</A></li>
<LI>Next message: <A HREF="011286.html">[Gtk-sharp-list] GTK# hscale, porting from a winforms application
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11285">[ date ]</a>
<a href="thread.html#11285">[ thread ]</a>
<a href="subject.html#11285">[ subject ]</a>
<a href="author.html#11285">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>On Sat, Aug 24, 2013 at 1:42 AM, vontux &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">mbeaven001 at gmail.com</A>&gt; wrote:
&gt;<i> Hello. I'm fairly new to using GTK#. I'm trying to port a video frontend
</I>&gt;<i> application I wrote using windows forms over to GTK#. In the windows forms
</I>&gt;<i> version, I was using the trackbar control to increment the video (it would
</I>&gt;<i> also tick up as the video played), when the MouseDown and MouseUp events
</I>&gt;<i> were fired they would tell the video to pause and play respectively. I
</I>&gt;<i> believe the hscale control is likely the way for me to go;however, I'm
</I>&gt;<i> afraid I don't know how to do with it what I was doing with the trackbar
</I>&gt;<i> control in winforms, I'm not seeing the equivalent events to MouseDown and
</I>&gt;<i> Mouseup from winforms. Anyone who can help me out with this I'd be
</I>&gt;<i> exceedingly grateful to.
</I>
I think the events you are looking for are ButtonPressEvent and
ButtonReleaseEvent.
You might be interested in taking a look at the seek slider
implemented in Banshee:
<A HREF="https://git.gnome.org/browse/banshee/tree/src/Core/Banshee.Widgets/Banshee.Widgets/SeekSlider.cs">https://git.gnome.org/browse/banshee/tree/src/Core/Banshee.Widgets/Banshee.Widgets/SeekSlider.cs</A>
It's an HScale subclass, and it does the &quot;seek to where I clicked&quot;.
The usual pause and play actions are done through a separate
Play/Pause button.
Cheers,
--
Bertrand
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="011284.html">[Gtk-sharp-list] GTK# hscale, porting from a winforms application
</A></li>
<LI>Next message: <A HREF="011286.html">[Gtk-sharp-list] GTK# hscale, porting from a winforms application
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11285">[ date ]</a>
<a href="thread.html#11285">[ thread ]</a>
<a href="subject.html#11285">[ subject ]</a>
<a href="author.html#11285">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
mailing list</a><br>
</body></html>