Drawing in memory with no GUI



Hi
New list member.  I'm more of a science guy 1st/programmer 2nd.  I'm a Physics prof at a small Univ in OK and I'm doing a sabbatical with the National Severe Storms lab in Norman.  I have successfully written a couple of small Gnome apps that display lightning data loops, etc.
 
My problem is that I want to be able to generate an image with code that runs strictly from the command line.  The Linux box I need to use, boots into the command line - no GUI has been started.  I just want to set up a pixmap in memory, draw on it (lines, circles, points based on data in files) and then read out the pixels into a simple image file (*.ppm).  It compiles OK using 
g++ -Wall -o DrawTest DrawTest.cc `gtk-config --cflags --libs`, but when it runs I get a segmentation fault/core dump message.  I whittled down the code so there's only two lines left (it crashes on the 2nd one)! 
 
#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>
 
int main(int argc,char *argv[])
  {

  GdkPixmap *pixmap;

  pixmap = gdk_pixmap_new(NULL,400,400,8);
 
/*  ------stuff--- */
  }
 
I really did try to dig through my books first, but everything is geared toward being in a windowing environment.  Can I do this with the GDK library?  I would greatly appreciate any advice anyone might have.  Thanks.
 
Brian Kaney
Tahlequah , OK
Assist. Physics Prof - Northeastern State Univ.
Visiting Researcher - National Severe Storms Lab 


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