Forum: Ruby-Gnome 2 Snapping a widget to another widget

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2007-04-11 00:10
(Received via mailing list)
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 :)

=
Search for products and services at:
http://search.mail.com

--
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...
35f0e7653d7404ac987b0383e1d76e2e?d=identicon&s=25 Martin Portman (Guest)
on 2007-04-11 09:42
(Received via mailing list)
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...
This topic is locked and can not be replied to.