?

Log in

No account? Create an account

Previous Entry | Next Entry

I want a Dock

So I'm working on one.

require 'wnck'

Gtk.init

w = Gtk::Window.new
b = Gtk::HBox.new
w.add b

Wnck::Screen.default.force_update
Wnck::Screen.default.windows.each do |win|
        but = Gtk::Button.new
        but.add Gtk::Image.new win.icon
        b.add but
end
w.show_all

Gtk.main

Dock

Comments

( 11 comments — Leave a comment )
noam_rion
May. 17th, 2005 01:46 am (UTC)
I read that as "I want a duck."

Nice dock! Very very simple code... not counting all the libraries underneath it. I like.
aredridel
May. 17th, 2005 11:16 am (UTC)
Yeah. The libraries are well organized — this is why I like GNOME. ruby-wnck has been fun to write, too.
lypanov
May. 17th, 2005 02:13 am (UTC)
Aredridel ++
he_was_here
May. 17th, 2005 05:32 am (UTC)
How to tell who is the geek...

When I read the subject I was sure you meant a wooden platform on a body of water where you tie boats up.
aredridel
May. 17th, 2005 11:18 am (UTC)
Haha. Nah, "Dock" has never meant much to me. Silly landlocked state I live in...
bluesbodger
May. 17th, 2005 09:28 am (UTC)
Yeah, but you've got a separate button for each window instance, so it's basically a system tray that takes up more space.

... Sweet start, though.
aredridel
May. 17th, 2005 11:17 am (UTC)
Yeah -- this was the 2am "My wnck test works, I wonder how hard it is to make what I want... whoa that was easy".

I can filter based on apps, now, and Metacity either just now supports or will shorly support focus-by-app instead of focus-by-window.
(Anonymous)
May. 17th, 2005 10:47 am (UTC)
You might want to make it chromeless so it's title bar does not eat space while it's still draggable with alt + mouse. Also try setting correct WM GTK hints so it does not appear in the window list and is perhaps treated as a dock/panel instead of a regular window.

-- Patrys
(Anonymous)
May. 17th, 2005 10:48 am (UTC)
Also: how about adding hints containing corresponding app names to the buttons?

-- Patrys
aredridel
May. 17th, 2005 11:18 am (UTC)
Getting there! This was the five-minute hack because wnck works ;-)
hitchhiker
May. 17th, 2005 12:01 pm (UTC)
looking sweet already!
( 11 comments — Leave a comment )