diff --git a/src/post_modules/GTK/source/gdkatom.pre b/src/post_modules/GTK/source/gdkatom.pre index 7da1ef000f9eef8173a6777af3cef0b456bacb12..4e124928e5025124b38c2f2065f98f8801c8a96b 100644 --- a/src/post_modules/GTK/source/gdkatom.pre +++ b/src/post_modules/GTK/source/gdkatom.pre @@ -8,6 +8,7 @@ NAME_ARGS(atom_name, only_if_exists); { char *atom_name; int only_if_exists; + pgtk_verify_setup(); get_all_args("GDK.Atom( string, int )",args,"%s%d",&atom_name,&only_if_exists); THIS->obj = (void *)gdk_atom_intern( atom_name, only_if_exists ); pop_n_elems(args); diff --git a/src/post_modules/GTK/source/gdkbitmap.pre b/src/post_modules/GTK/source/gdkbitmap.pre index 690140fa9e00b55d8793d3a7ceffd2309134fec5..eead3282bb52323765fc2c69944abcfa2564fc06 100644 --- a/src/post_modules/GTK/source/gdkbitmap.pre +++ b/src/post_modules/GTK/source/gdkbitmap.pre @@ -12,6 +12,7 @@ NAME_ARGS(image|xsize, void|ysize, void|xbitmapdata); { int x, y; char *d; + pgtk_verify_setup(); if(args == 3) { get_all_args("create", args, "%d%d%s", &x, &y, &d ); diff --git a/src/post_modules/GTK/source/gdkcolor.pre b/src/post_modules/GTK/source/gdkcolor.pre index 3bff682c861e2125dc78863ead07300a2f6aed45..79ebec67a645f30618ae1c321dd93abe1930426c 100644 --- a/src/post_modules/GTK/source/gdkcolor.pre +++ b/src/post_modules/GTK/source/gdkcolor.pre @@ -13,6 +13,7 @@ NAME_ARGS(r|color,g,b); int r,g,b; GdkColormap *col = gdk_colormap_get_system(); GdkColor *c; + pgtk_verify_setup(); if( args == 1) { struct object *o; diff --git a/src/post_modules/GTK/source/gdkdragcontext.pre b/src/post_modules/GTK/source/gdkdragcontext.pre index 37fd79ae057f203eb6a2f40ccfb2fc57b6c70bb7..3dbe2fbd86fa1cae2ad31e2d88789e7cf96951e1 100644 --- a/src/post_modules/GTK/source/gdkdragcontext.pre +++ b/src/post_modules/GTK/source/gdkdragcontext.pre @@ -1,6 +1,6 @@ PROGRAM(GdkDragContext); // The drag context contains all information about the drag'n'drop -// connected to the signal. +// connected to the signal to which it is an argument. // <p> // NOIMG #define GTK_GDKDRAGCONTEXT(X) ((GdkDragContext *)X) diff --git a/src/post_modules/GTK/source/gdkfont.pre b/src/post_modules/GTK/source/gdkfont.pre index b7ece6e94e64586e94cfbc43cfa8ce8c89026cc0..364bd545caf6e21bd26176842ac55cbbf2f9ef95 100644 --- a/src/post_modules/GTK/source/gdkfont.pre +++ b/src/post_modules/GTK/source/gdkfont.pre @@ -59,6 +59,7 @@ NAME_ARGS(font_name); // Create a new font object. The string is the font XLFD. { char *n; + pgtk_verify_setup(); if(args) { get_all_args("Gdk.Font", args, "%s", &n); diff --git a/src/post_modules/GTK/source/gdkgc.pre b/src/post_modules/GTK/source/gdkgc.pre index 81edb61a0905acdf7ea64932cf81e0bdd2b3ef8c..4b945f701dc43b63c1a1a36af2565faa4b7b996e 100644 --- a/src/post_modules/GTK/source/gdkgc.pre +++ b/src/post_modules/GTK/source/gdkgc.pre @@ -12,6 +12,7 @@ NAME_ARGS(context); // which the gc will be valid. { struct object *o; + pgtk_verify_setup(); get_all_args("'()", args, "%o", &o); if(get_gdkobject(o, Drawable)) THIS->obj = (void *)gdk_gc_new( (GdkWindow*)get_gdkobject(o,Drawable) ); diff --git a/src/post_modules/GTK/source/gdkimage.pre b/src/post_modules/GTK/source/gdkimage.pre index 63b096387e7903c0126e3d33b3acb32eb3a02418..1a7d28af6b7662c35c5048018c8ddc2277977ae7 100644 --- a/src/post_modules/GTK/source/gdkimage.pre +++ b/src/post_modules/GTK/source/gdkimage.pre @@ -3,21 +3,33 @@ PROGRAM(GdkImage); // Mainly used for W(Image) objects. // // NOIMG -FUNCTION(create, "function(int|void:void)"); -NAME_ARGS(fast_mode); -// Create a new GDK.Image object. The argument is either 0, which indicates that -// you want a 'slow' image. If you use '1', you indicate that you want a 'fast' -// image. Fast images are stored in shared memory, and thus are not sent over -// any network. But please limit your usage of fast images, they use up -// a possibly limited system resource set. See the man page for shmget(2) -// for more information on the limits on shared segments on your system. +FUNCTION(create, "function(int|void,object|void:void)"); +NAME_ARGS(fast_mode,image); +// Create a new GDK.Image object. The firstargument is either 0, which +// indicates that you want a 'slow' image. If you use '1', you +// indicate that you want a 'fast' image. Fast images are stored in +// shared memory, and thus are not sent over any network. But please +// limit your usage of fast images, they use up a possibly limited +// system resource set. See the man page for shmget(2) for more +// information on the limits on shared segments on your system. //<p> -// A 'fast' image will automatically revert back to 'slow' mode if no shared -// memory is available. + +// A 'fast' image will automatically revert back to 'slow' mode if no +// shared memory is available. +// <p> +// If the second argument is specified, it is the actual image data. { + void pgtk_GdkImage_set( int ); + pgtk_verify_setup(); THIS->extra_int = GDK_IMAGE_NORMAL; - if(args && sp[-1].u.integer) + if(args && sp[-args].u.integer) THIS->extra_int = GDK_IMAGE_FASTEST; + if( args == 2) + { + stack_swap(); + pop_stack(); + pgtk_GdkImage_set( 1 ); + } /* Do not add one extra ref for the internal gdk object..*/ /* add_ref(fp->current_object); */ } diff --git a/src/post_modules/GTK/source/gdkpixmap.pre b/src/post_modules/GTK/source/gdkpixmap.pre index a9327488fe5dbec49b30e13561f5a56cb6aa88d9..c43d325a9f9032c17aa4d9354062132ee9cc7c7f 100644 --- a/src/post_modules/GTK/source/gdkpixmap.pre +++ b/src/post_modules/GTK/source/gdkpixmap.pre @@ -39,6 +39,7 @@ NAME_ARGS(image); GdkImage *i; int f = 0; struct object *o; + pgtk_verify_setup(); if(THIS->obj) error("Pixmap already initialized\n"); diff --git a/src/post_modules/GTK/source/gdkrectangle.pre b/src/post_modules/GTK/source/gdkrectangle.pre index 01b38ab3a2ebe5d08c134ad5f636986473acee6a..c9577fe92f69261793d3a363d7e7f49730314a08 100644 --- a/src/post_modules/GTK/source/gdkrectangle.pre +++ b/src/post_modules/GTK/source/gdkrectangle.pre @@ -6,6 +6,7 @@ NAME_ARGS(x,y,width,height); // NOIMG { GdkRectangle *r; + pgtk_verify_setup(); THIS->obj = (void *)(r=malloc(sizeof(GdkRectangle))); get_all_args( "GDK.Rectangle", args, "%d%d%d%d", &r->x, &r->y, &r->width, &r->height ); diff --git a/src/post_modules/GTK/source/gdkregion.pre b/src/post_modules/GTK/source/gdkregion.pre index ff0402c4a62cc3f41f1c72e0192c13ce50cf6522..7ebcceee1ff51a81830e9ce66ac9d5ccbee4dd35 100644 --- a/src/post_modules/GTK/source/gdkregion.pre +++ b/src/post_modules/GTK/source/gdkregion.pre @@ -16,6 +16,7 @@ FUNCTION(create, "function(void:void)"); // // NOIMG { + pgtk_verify_setup(); THIS->obj = (void *)gdk_region_new(); } FUNCTION(destroy, "function(void:void)"); diff --git a/src/post_modules/GTK/source/gdkwindow.pre b/src/post_modules/GTK/source/gdkwindow.pre index 2609ab489819bf251bda5819edcc2b14e08915d9..3fa6fbc352fd6453cbb0fc1ca13d16ce0e5e84e4 100644 --- a/src/post_modules/GTK/source/gdkwindow.pre +++ b/src/post_modules/GTK/source/gdkwindow.pre @@ -8,6 +8,7 @@ ARGS(int|object,void|mapping); NAME_ARGS(XWindowID|parent,void|atrributes); // Not for non-experts. I promise. { + pgtk_verify_setup(); if(sp[-args].type == T_INT) { int id; diff --git a/src/post_modules/GTK/source/gtkbutton.pre b/src/post_modules/GTK/source/gtkbutton.pre index bcb0d2ac7f9d73e9df779a5d19a5181c797ffd67..c4481585b2ebac4eaefa48e6a85365dfe885ae93 100644 --- a/src/post_modules/GTK/source/gtkbutton.pre +++ b/src/post_modules/GTK/source/gtkbutton.pre @@ -18,7 +18,8 @@ FUNCTION(create, "function(string|void:void)") NAME_ARGS(label_text); // If a string is supplied, a W(Label) is created and added to the button. { - if(THIS->obj) error("GTK.Button->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtkcheckbutton.pre b/src/post_modules/GTK/source/gtkcheckbutton.pre index d2fd1a1ece7c1aaca12a0069b2be3f104546060e..204ac9c80dc23736d97c0e5c687ef9bc132c941f 100644 --- a/src/post_modules/GTK/source/gtkcheckbutton.pre +++ b/src/post_modules/GTK/source/gtkcheckbutton.pre @@ -12,7 +12,8 @@ NAME_ARGS(label); // If no label is specified, use object->add() to add some // other widget (such as an pixmap or image widget) { - if(THIS->obj) error("GTK.Check_button->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtkcheckmenuitem.pre b/src/post_modules/GTK/source/gtkcheckmenuitem.pre index e9de6f23f7d0e85d836e00a3752823049119e18a..4ff5954ac070c32d8c0ddbfcc5bf5adb05412ba9 100644 --- a/src/post_modules/GTK/source/gtkcheckmenuitem.pre +++ b/src/post_modules/GTK/source/gtkcheckmenuitem.pre @@ -11,7 +11,8 @@ NAME_ARGS(label); // If no label is specified, use object->add() to add some // other widget (such as an pixmap or image widget) { - if(THIS->obj) error("GTK.Check_menu_item->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtklistitem.pre b/src/post_modules/GTK/source/gtklistitem.pre index b0e19810d5caa49e4422f7de61d706c1352d1585..747b3f8c9586d059ee0623c851ab16ce904247a7 100644 --- a/src/post_modules/GTK/source/gtklistitem.pre +++ b/src/post_modules/GTK/source/gtklistitem.pre @@ -7,7 +7,8 @@ NAME_ARGS(label); // string and added to the item. Otherwise, you should add another // widget to the list item with ->add(). { - if(THIS->obj) error("GTK.List_item->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtkmenuitem.pre b/src/post_modules/GTK/source/gtkmenuitem.pre index 6294fb84dbcb9047e2f57f20e8d04f32ffe31143..abe0a6317d4de9ea26a907dafccdb04ded666ef0 100644 --- a/src/post_modules/GTK/source/gtkmenuitem.pre +++ b/src/post_modules/GTK/source/gtkmenuitem.pre @@ -8,7 +8,8 @@ NAME_ARGS(label); // string and added to the item. Otherwise, you should add another // widget to the list item with ->add(). { - if(THIS->obj) error("GTK.Menu_item->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtkradiobutton.pre b/src/post_modules/GTK/source/gtkradiobutton.pre index 91df965c09083812fd6e42fcaa96dec801985735..9f8a055d89517054117700f1a4dd8b0a73ca6090 100644 --- a/src/post_modules/GTK/source/gtkradiobutton.pre +++ b/src/post_modules/GTK/source/gtkradiobutton.pre @@ -26,7 +26,8 @@ NAME_ARGS(title,groupmember); o = sp[-1].u.object; } - if(THIS->obj) error("GTK.RadioButton->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(o) mylist=gtk_radio_button_group(GTK_RADIO_BUTTON(get_gtkobject(o))); diff --git a/src/post_modules/GTK/source/gtkradiomenuitem.pre b/src/post_modules/GTK/source/gtkradiomenuitem.pre index 8a914082f96309ae7ace9013692b8c55eaec77d2..891df058c4233e9ed28fb8b77e60e02269b58297 100644 --- a/src/post_modules/GTK/source/gtkradiomenuitem.pre +++ b/src/post_modules/GTK/source/gtkradiomenuitem.pre @@ -20,7 +20,8 @@ NAME_ARGS(title,groupmember); o = sp[-1].u.object; } - if(THIS->obj) error("GTK.Radio_group->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(o) mylist=gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(get_gtkobject(o))); if(label) diff --git a/src/post_modules/GTK/source/gtktogglebutton.pre b/src/post_modules/GTK/source/gtktogglebutton.pre index 8fd0fe2a25ad425dd55f2754fee7b43e84c70be7..05eec566f58438ac4a0430ce34c8608f59374652 100644 --- a/src/post_modules/GTK/source/gtktogglebutton.pre +++ b/src/post_modules/GTK/source/gtktogglebutton.pre @@ -14,7 +14,8 @@ NAME_ARGS(label); // If you supply a string, a label will be created and inserted in the button. // Otherwise, use ->add(widget) to create the contents of the button. { - if(THIS->obj) error("GTK.Toggle_button->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s; diff --git a/src/post_modules/GTK/source/gtktreeitem.pre b/src/post_modules/GTK/source/gtktreeitem.pre index 0b495d6bd9470316543b2db14e436d8a60b84ef2..e59e73abac734d4d47b9462c5c5892f99d02b65b 100644 --- a/src/post_modules/GTK/source/gtktreeitem.pre +++ b/src/post_modules/GTK/source/gtktreeitem.pre @@ -10,7 +10,8 @@ NAME_ARGS(label); // If you specify a string it is used as a label, otherwise pack a widget // in the tree item with ->add(widget). { - if(THIS->obj) error("GTK.Tree_item->create() can only be called once.\n"); + pgtk_verify_not_inited(); + pgtk_verify_setup(); if(args) { char *s;