[Gtk-sharp-list] GTK# hscale, porting from a winforms application

Bertrand Lorentz bertrand.lorentz at gmail.com
Tue Aug 27 13:45:15 UTC 2013


On Sat, Aug 24, 2013 at 1:42 AM, vontux <mbeaven001 at gmail.com> wrote:
> Hello. I'm fairly new to using GTK#. I'm trying to port a video frontend
> application I wrote using windows forms over to GTK#. In the windows forms
> version, I was using the trackbar control to increment the video (it would
> also tick up as the video played), when the MouseDown and MouseUp events
> were fired they would tell the video to pause and play respectively. I
> believe the hscale control is likely the way for me to go;however, I'm
> afraid I don't know how to do with it what I was doing with the trackbar
> control in winforms, I'm not seeing the equivalent events to MouseDown and
> Mouseup from winforms. Anyone who can help me out with this I'd be
> exceedingly grateful to.

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:
https://git.gnome.org/browse/banshee/tree/src/Core/Banshee.Widgets/Banshee.Widgets/SeekSlider.cs

It's an HScale subclass, and it does the "seek to where I clicked".
The usual pause and play actions are done through a separate
Play/Pause button.

Cheers,

--
Bertrand


More information about the Gtk-sharp-list mailing list