Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-27 Thread Martin Nordholts
Sven Neumann wrote: > On Sun, 2009-12-27 at 11:18 +0100, Louise Hoffman wrote: >>> I strongly suggest that you read the tutorial on developer.gimp.org >>> then: >>> >>> http://developer.gimp.org/writing-a-plug-in/1/index.html >> I read that one, and it was from that, I copied a lot of the code. I

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-27 Thread Sven Neumann
On Sun, 2009-12-27 at 11:18 +0100, Louise Hoffman wrote: > > I strongly suggest that you read the tutorial on developer.gimp.org > > then: > > > > http://developer.gimp.org/writing-a-plug-in/1/index.html > > I read that one, and it was from that, I copied a lot of the code. I > was why I had all

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-27 Thread Louise Hoffman
> I strongly suggest that you read the tutorial on developer.gimp.org > then: > >  http://developer.gimp.org/writing-a-plug-in/1/index.html I read that one, and it was from that, I copied a lot of the code. I was why I had all this pointer and structs at first =) > and perhaps study the code of a

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-27 Thread Louise Hoffman
> No you got an error. 0, or FALSE, means "error" which you can read in the > documentation for the function: > > http://developer.gimp.org/api/2.0/libgimp/libgimp-gimpdrawable.html#gimp-drawable-set-pixel Now I see =) And now I get my red pixel as I wanted =) gboolean s; guint8 pixel[] = { 0

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-27 Thread Sven Neumann
On Sat, 2009-12-26 at 19:03 +0100, Louise Hoffman wrote: > > You can't show a drawable by itself, it needs to be in an image. Also, an > > image can't show itself, you must create a display for that. You are also > > using the API in weird ways, for example, objects such as layers and images > > ar

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Martin Nordholts
Louise Hoffman wrote: > Now I don't get any errors, but I don't see the pixel either... > > /* Trying to set a pixel at x=5,y=5 with value 150 in 24 bit color */ > const guint8 *pixel; > pixel = (guint8 *) "150"; > gboolean s; > s = gimp_drawable_set_pixel (layer, 5, 5, 24, pixel); > p

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Louise Hoffman
> As I said, in the plug-in context layers (and drawables) are identified by > integers, not pointers. Looks like you try to use a struct pointer again. > > Plug-ins run in their own process and thus pointer-passing doesn't work. Sorry about that. Now I don't get any errors, but I don't see the p

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Martin Nordholts
Louise Hoffman wrote: > hello-world.c:73: warning: passing argument 1 of > ‘gimp_drawable_set_pixel’ makes integer from pointer without a cast > /usr/include/gimp-2.0/libgimp/gimpdrawable_pdb.h:89: note: expected > ‘gint32’ but argument is of type ‘struct GimpDrawable *’ As I said, in the plug-in

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Louise Hoffman
> Your invocation of 'gimp_install_procedure' specifies NULL for the > image_type. This is probably what you want -- you don't need an image > opened in order to create a new image -- but this means that you > shouldn't be using GIMP_PDB_IMAGE and GIMP_PDB_DRAWABLE in your > GimpParamDef (if there

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Louise Hoffman
> You can't show a drawable by itself, it needs to be in an image. Also, an > image can't show itself, you must create a display for that. You are also > using the API in weird ways, for example, objects such as layers and images > are represented by integers in the plug-in context. > > You are als

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Louise Hoffman
> File->New creates a new image, not a new drawable. Okay, I had that mixed up. A new image is really what I wanted then =) ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-develop

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread saulgoode
Quoting Louise Hoffman : > When I select the plugin in GIMP I get these errors: > > Calling error for procedure 'gimp-drawable-width': Procedure > 'gimp-drawable-width' has been called with an invalid ID for argument > 'drawable'. Most likely a plug-in is trying to work on a layer that > doesn't e

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Martin Nordholts
Louise Hoffman wrote: Dear developers, I am trying to make a GIMP plugin that can open a new drawable on the screen. Just like when you make one from File->New. Hi! You can't show a drawable by itself, it needs to be in an image. Also, an image can't show itself, you must create a display fo

Re: [Gimp-developer] Plugin that can open a drawable on screen. What am I doing wrong?

2009-12-26 Thread Sven Neumann
On Sat, 2009-12-26 at 13:51 +0100, Louise Hoffman wrote: > Dear developers, > > I am trying to make a GIMP plugin that can open a new drawable on the > screen. Just like when you make one from File->New. > > It should be 800x600 24bit greyscale. File->New creates a new image, not a new drawable.