Re: Writing panel applets?



Quoting Eric M. Ludlam (zappo@ultranet.com):
> I've been trying to understand applets for the panel recently, and
> much about them seems straight forward, though I have one problem, and
> one suggestion.
> 
> First, "panel.h" and "applet-lib.h" are not installed with any of the
> -devel RPMs.  (At least, I have no clue where they are hiding.)  This
> will make it quite hard for me to make a separate distribution w/ an
> applet that gets configure'd right.

it should be in the gnome-core ... though it doesn't install ... hmm maybe
there should be a gnome-core-devel package then .. and we should make 
it install those ...

can someone with more automake experience do that????

> Also, is it it possible to subclass an applet?  I think this would
> be very useful.  While fiddling, I found that I just copied "launcher"
> and added a few things to it.  That's a lot of duplicated code.

all the applets aren't written as widgets so they can't be subclassed
.... if you can write a widget that will make applet creation easier ...
plese do go ahead

> Why would I subclass launcher?  I'm glad you asked!  I'd like my app
> to sit there, and if a talk request comes in, it would change it's
> image (similar to mailcheck) and maybe fork off a sound event of some
> sort.  At the same time, I'd like the user to click on it, and have it
> execute "gtalk -r" or "ytalk user@machine", using those nifty launcher
> features.  The only thing launcher is missing is the code to get talk
> requests, and that happens to be something I know how to do. ;)

well the launher is probably not a good applet to copy ... it has
several problems as a general applet ... it doesn't restart itself,
etc etc etc ... it's amde for an entierly different purpose ... what
you want to copy is something like mailcheck ... and you could just
put a button with the image on tehre and connect to the button 
a function that does

system("(gtalk -r &)");

really the launcher applet is NOT soemthing you want to copy .... since
it has not been made as a general applet, but rather as a temporary
replacement to mc ...

> I think mailcheck, and even cpuload would benefit from this too, since
> mailcheck would like to launch/talk to balsa, (or whatever), and the
> cpumeter would probably like to launch gtop (or whatever).  The clock
> might want to launch the calendar.  See the pattern?

that would be quite simple ... just connect a function to some signals

most likely I would put this in the right click menu .... which is easy
to add to ... so you see new mail .. so you right click and select
"launch balsa" or something ... same thing with the cdplayer applet, clock,
mixer, whatever ...

> Due to the nature of Corba in C, this might not be as easy at it
> sounds.  If corba events were translated into gtk style signals for a
> stock applet, the coolness factor would be impressive, and make
> writing applets for add-ons easier.

this was to be one of my next projects .... an abstracted applet-widget
... which would take care of everything, the corba events would be added
like signals ... and the launcher initiation would also be done
automatically ... this will take some time ... if you want to take a
stab at it ... go right ahead

> Anyway, I hope the needed header files appear in one of the periodic
> RPMS soon, or that someone could inform me of my error.

George

-- 
------------------------------------------------------------------------------
George Lebl <jirka@5z.com> http://www.5z.com/jirka/
------------------------------------------------------------------------------
  The following implements RSA in perl and is illegal to export from the US:

          #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
          $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
          lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)



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