Re: Drag boxes?



On 8/24/07, Aaron Geier <ageier catalystmicro com> wrote:
>
> -Hello,
>
>  Sorry for asking so many questions, but I have another question on "drag
> boxes".
>
>  On the desktop one can click and hold the left mouse button, then drag it
> across the screen, and a drag box appears.  Anything within the box then
> becomes "selected."
>
>  On the windows and widgets that I've created in gtkmm, there is no "drag
> box."  I can log mouse click events, and whether or not something has been
> crossed; however, I do not get a "drag box."
>
>  Is there a built in way in gtkmm to do a "drag box."  And if there is no
> built in way, has anyone ever tried to implement a "drag box"?

well, it depends on what widget you're trying to do this with.  In
Gtk-land this is generally called "rubber-banding".  There is a
built-in support for this in some widgets. TreeView got a
set_rubber_banding() [1] function recently that will do this
automatically for treeview widgets. IconView [2] has supported
rubber-banding for a while now. But I don't believe there's any
generic way to do this for arbitrary widgets.  You'd probably need to
implement it yourself or find an application that does it and copy
what they did (assuming your license is compatible).

[1] http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeView.html#9389a98f6068e09e33fec8e7a98219ab
[2] http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1IconView.html
-- 
jonner



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]