[Goodies-dev] Advise on SVG/Pixmap

Bruno Jesus XFCE myxfce at gmail.com
Thu Aug 31 04:14:38 CEST 2006

On 8/28/06, Álvaro Lopes <alvieboy at alvie.com> wrote:
> I know, I'm kinda boring with all these questions.
> I need to have a visual indicator of current modem status for my applet (not ppp, just network registration - it's for cellular modems), which must display if
> it is registered to the network or if it is not, and if a PIN is needed to start the registration process. I tought about creating a simple pixmap similar to a
> LED (either green, red, or yellow, flashing or not flashing) to show the actual status (besides the progress bar). What I am not sure is if its best to make a
> SVG one so that it can be resized according to panel size.

I think it's easier to use Pixmaps files because they can be easily
resized with the function :

static GdkPixbuf *
load_and_scale(const guint8 *data, int dstw, int dsth)
  int pb_w, pb_h;
  GdkPixbuf *pb, *pb_scaled;

  pb = gdk_pixbuf_new_from_inline(-1, data, FALSE, NULL);
  pb_w = gdk_pixbuf_get_width(pb);
  pb_h = gdk_pixbuf_get_height(pb);

  if (dstw == pb_w && dsth == pb_h)
  else if (dstw < 0)
	dstw = (dsth * pb_w) / pb_h;
  else if (dsth < 0)
	dsth = (dstw * pb_h) / pb_w;

  pb_scaled = gdk_pixbuf_scale_simple(pb, dstw, dsth, GDK_INTERP_HYPER);



Where "data" is the pixmap and dstw is the width and dsth is the
height. The function returns a new resized pixmap.

> Also in my TODO list is support to start/stop ppp connection on this modem, so I would want another indicator for the current PPP status (started/stopped) and
> to click on it to start/stop PPP connection. Again, better use a pixmap or a SVG?
> The LED idea came from my other applet application (for WMaker) called wmnetmon ( http://freshmeat.net/projects/wmnetmon/ ).
> Álvaro
> DISCLAIMER: This message may contain confidential information or privileged material and is intended only for the individual(s) named. If you are not a named addressee and mistakenly received this message you should not copy or otherwise disseminate it: please delete this e-mail from your system and notify the sender immediately. E-mail transmissions are not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. Therefore, the sender does not accept liability for any errors or omissions in the contents of this message that arise as a result of e-mail transmissions. Please request a hard copy version if verification is required. Critical Software, SA.
> _______________________________________________
> Goodies-dev mailing list
> Goodies-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/goodies-dev

More information about the Goodies-dev mailing list