Alert the taskbar

View: New views
3 Messages — Rating Filter:   Alert me  

Alert the taskbar

by NOT_Skeletor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been doing some of the tutorials over at kksou's site (fantastic, BTW. It should be required reading for anyone learning php-gtk).

I am building a small chat GUI to interact with one I did already in PHP with jQuery, and everything is going swimingly. But, I had a couple questions i was unable to find answers for and thought someone could help me.

Firstly, I would love to know how to "alert" the taskbar. That is, when the applicaiton is running and an even happens (like a new message comes in, for example) but the window does not currently have focus, how can I make the taskbar entry "blink"? I'm sure theres another word for it, but I'm not familiar with GTK at all so I just don't know. Basically, how can I alert the user something has happened using the entry in the taskbar.

Secondly, I did the tutorial at kksou's site for the GtkStatusIcon, and its fantastic! The chat also has a queue of users waiting to chat, and it would be great if I could pop a menu from the status icon from some event (like a new user comes in).

Any ideas would be appreciated (that or let me know its impossible right now and I guess I'll have to leave it at that)

Re: Alert the taskbar

by bob majdak jr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Firstly, I would love to know how to "alert" the taskbar.

Since 2.8 GTK has had GtkWindow::set_urgency_hint(). See
this code example: http://p.opsat.net/t/yo

> Secondly, I did the tutorial at kksou's site for the GtkStatusIcon, and its
> fantastic! The chat also has a queue of users waiting to chat, and it would
> be great if I could pop a menu from the status icon from some event (like a
> new user comes in).

Build your GtkMenu, and then use the ->popup() method on
it when you want it to pop up. Remember to use the
GtkStatusIcon::position_menu method in the popup so that
it actually pops up over the icon. Really no different
than doing a normal menu except you are calling the popup
method instead of the user interface events.

---
Bob Majdak Jr
KateOS Rofflecopter Pilot
http://www.kateos.org

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Alert the taskbar

by NOT_Skeletor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fantastic! Thank you so much, that was exactly what I wanted. And speedy to boot. Thanks a lot, I really do appreciate it. One of those things thats kept me up nights trying to figure it out.

bob majdak jr wrote:
> Firstly, I would love to know how to "alert" the taskbar.

Since 2.8 GTK has had GtkWindow::set_urgency_hint(). See
this code example: http://p.opsat.net/t/yo

> Secondly, I did the tutorial at kksou's site for the GtkStatusIcon, and its
> fantastic! The chat also has a queue of users waiting to chat, and it would
> be great if I could pop a menu from the status icon from some event (like a
> new user comes in).

Build your GtkMenu, and then use the ->popup() method on
it when you want it to pop up. Remember to use the
GtkStatusIcon::position_menu method in the popup so that
it actually pops up over the icon. Really no different
than doing a normal menu except you are calling the popup
method instead of the user interface events.

---
Bob Majdak Jr
KateOS Rofflecopter Pilot
http://www.kateos.org

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php