Snapping a widget to another widget

Hi
In winamp, but also in beep-media-player, you can drag a little
widget like the playlist, and attached it to another widget like
the equalizer. I think this functionanility rocks.

Is this somehow possible in ruby-gtk?

Else I’d really have to dig into the C code of beep-media-player
to find out how they do it, then try to wrap something around
it… but my C is really bad :slight_smile:

=
Search for products and services at:


Powered by Outblaze


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Roebe XXX wrote:

Hi
In winamp, but also in beep-media-player, you can drag a little
widget like the playlist, and attached it to another widget like
the equalizer. I think this functionanility rocks.

Is this somehow possible in ruby-gtk?

I don’t know winamp, but I assume you want some way of customizing the
UI at run-time by dragging widgets around.

As a starting point take a look at Gtk::HandleBox. With it you can
detach a widget from its original location and it will appear in a
frame which sort of floats above the original app. You can then
reattach it. I believe you are forced to reattach it back to
its original location, so this isn’t exactly what you want.

If this is not enough, it shouldn’t be too hard to code your own
solution, with a bit of drag and drop (see Gtk::Drag) and reparenting
of the dragged widget.

Martin.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV