gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gimp-docs | yesterday 10:55 PM
    a new user perspective
  2. gimp-developer | yesterday 08:04 PM
    scanner support should be File->Acquire
  3. gegl-developer | yesterday 06:24 PM
    babl docs
  4. gimp-docs | yesterday 12:46 PM
    GIMP Manual
  5. gimp-user | yesterday 09:42 AM
    Bug

External news

Poll

How good are you at programming?

OMG, that is nothing for me at all!

I've been coding a little bit but I'm not very fit at it

I'm pretty good at programming and would maybe be able to write a Plug-In for GIMP

I'm very good at programming and I would theoretically be able to hack for the GIMP core

See results

Stats

gimpusers.com RSS feed

GIMP Forums » For GIMP developers

how to create a window in gimp plugin?

Jump to message:

  1. how to create a window... — gbstack, 02 Jul 2009 08:01 AM
    1. how to create a window... — Adam Turcotte, 02 Jul 2009 05:52 PM
    2. how to create a window... — Martin Nordholts, 02 Jul 2009 07:56 PM
    3. how to create a window... — Sven Neumann, 02 Jul 2009 10:01 PM
      1. how to create a window... — gbstack, 03 Jul 2009 07:16 AM

As a registered user, you can subscribe forum threads in order to get notified when replies are posted. Just log in at the right top of the page if you already have an account, otherwise you can register for free.

Permalink:4A4C4D2C.4080904@gmail.com
Date:02 Jul 2009 08:01 AM
From:gbstack
Subject:how to create a window in gimp plugin?
Hello,everybody!

I want to create a window in gimp plugin,so this is my code(part of the
plugin):

/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;
GimpRunMode run_mode;
GtkWidget *window;

gtk_init();

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

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

/* Getting run_mode - we won't display a dialog if
* we are in NONINTERACTIVE mode */
run_mode = param[0].data.d_int32;

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window),"hello");
gtk_widget_show(window);

gtk_main();

}

/but when I ran the plugin in gimp,it didn't work...
and this is the error message:

(hello:12429): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(hello:12429): GLib-GObject-CRITICAL **: g_signal_connect_data:
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(hello:12429): LibGimp-CRITICAL **: gimp_window_set_transient: assertion
`gimp_ui_initialized' failed

(hello:12429): Gtk-WARNING **: Screen for GtkWindow not set; you must
always set
a screen for a GtkWindow before using the window

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_default_colormap:
assertion `GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion
`GDK_IS_COLORMAP (colormap)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_default_colormap:
assertion `GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion
`GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion
`GDK_IS_SCREEN (screen)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW
(parent)' failed

(hello:12429): Gdk-CRITICAL **:
gdk_window_enable_synchronized_configure: assertion `GDK_IS_WINDOW
(window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_user_data: assertion
`window != NULL' failed

(hello:12429): Gtk-CRITICAL **: gtk_style_attach: assertion `window !=
NULL' failed

(hello:12429): Gtk-CRITICAL **: gtk_style_set_background: assertion
`GTK_IS_STYLE (style)' failed

(hello:12429): Gtk-CRITICAL **: gtk_paint_flat_box: assertion
`GTK_IS_STYLE (style)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_accept_focus: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_focus_on_map: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_modal_hint: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gtk-CRITICAL **: gtk_window_realize_icon: assertion
`widget->window != NULL' failed

(hello:12429): Gtk-WARNING **: Screen for GtkWindow not set; you must
always set
a screen for a GtkWindow before using the window

(hello:12429): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unmaximize: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unstick: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_deiconify: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_unfullscreen: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_keep_above: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_set_keep_below: assertion
`GDK_IS_WINDOW (window)' failed

(hello:12429): Gdk-CRITICAL **: gdk_window_show: assertion
`GDK_IS_WINDOW (window)' failed

anyone can tell me how to fix it?

any suggestion is appreciated.



Regards,
Todong Ma.
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:1c8827380907020852h6f85985fpc4bdfb586...
Date:02 Jul 2009 05:52 PM
From:Adam Turcotte
Subject:how to create a window in gimp plugin?
On Thu, Jul 2, 2009 at 2:01 AM, gbstack<gbstack08@gmail.com> wrote:
> I want to create a window in gimp plugin

I'm not sure if this helps, but when I've created gimp plugins, I've
always used gimp_dialog_new () instead of gtk_window_new ().

For an example, take a look at the scale_dialog () method here:
http://gsoc.rivetsforbreakfast.com/gimp/IBFNBQH.c



Adam Turcotte
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:4A4CF545.3090102@gmail.com
Date:02 Jul 2009 07:56 PM
From:Martin Nordholts
Subject:how to create a window in gimp plugin?
On 07/02/2009 08:01 AM, gbstack wrote:
> Hello,everybody!
>
> I want to create a window in gimp plugin,so this is my code(part of the
> plugin):
>
> any suggestion is appreciated.
>

One way that always works is looking at how other plug-ins does it, for
example:
http://git.gnome.org/cgit/gimp/tree/plug-ins/common/decompose.c

Look in/around decompose_dialog()

/ Martin
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:1246564883.9787.11.camel@bender
Date:02 Jul 2009 10:01 PM
From:Sven Neumann
Subject:how to create a window in gimp plugin?
Hi,

On Thu, 2009-07-02 at 14:01 +0800, gbstack wrote:
> Hello,everybody!
>
> I want to create a window in gimp plugin,so this is my code(part of the
> plugin):

Please have a look at
http://developer.gimp.org/writing-a-plug-in/1/index.html

In particular part III of this tutorial should be helpful.


Sven
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:4A4D9410.2010607@gmail.com
Date:03 Jul 2009 07:16 AM
From:gbstack
Subject:how to create a window in gimp plugin?
Hi,
thanks for your tutorials,plugin examples and suggestions.

now it's fixed,if I use gimp_ui_init instead of gtk_init,I can create a
GtkWindow in gimp plugin now.

thank you all! :-)


Regards,
Todong Ma
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview

Adobe® Photoshop® is a registered trademark of Adobe Systems, Inc. Linux is a trademark of Linus Torvalds. Ubuntu and Canonical are registered trademarks of Canonical Ltd. | Clock times are shown as CET / CEST | Imprint / Privacy policy | powered by bitfire it services | sponsored by Hirners Hotel Guide