On 9/12/06, Dream Artist Aspiring <[EMAIL PROTECTED]> wrote:


Hi all, I am very new to gimp and it's development. I am trying to learn 
gimp-plugins. I can run the plugin fine for the first using  the Xtns->... 
menu. But if I want to run the same plugin for second time, the menu entry is 
disabled. Is there something that I am doing wrong? please let me know. Thanks 
much in advance.

HERE IS MY CODE:
---------------------------
static void
run (const gchar      *name,
     gint              nparams,
     const GimpParam  *param,
     gint             *nreturn_vals,
     GimpParam       **return_vals)
{

  static GimpParam  values[1];
  GimpPDBStatusType status = GIMP_PDB_SUCCESS;

  gint32 SImg, SLay;

  /* Setting mandatory output values */
  *nreturn_vals = 1;
  *return_vals  = values;

  values[0].type = GIMP_PDB_STATUS;
  values[0].data.d_status = status;

  SImg = gimp_image_new(720,720,GIMP_RGB);
  SLay = gimp_layer_new(SImg, "Layer1", 720, 720, GIMP_RGB_IMAGE, 100, 
GIMP_NORMAL_MODE);
  gimp_image_add_layer(SImg, SLay, 0);
  gimp_drawable_fill(SLay, GIMP_BACKGROUND_FILL);
  gimp_display_new(SImg);
  gimp_displays_flush();

  return;
}

I don't see anything obviously wrong with this code, but you left out
the registration part.  I'm going to guess that you registered this as
an extension and not as a plugin.  That might cause the symptoms you
describe.  (This is one of several reasons why Xtns is a bad name for
that menu.)

Rockwalrus
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to