 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
dennisWonders Familiar Face
Joined: 20 Feb 2007 Posts: 12 Location: hyd
|
Posted: Fri Apr 27, 2007 9:51 am Post subject: Problem with glade 2.12.1? |
|
|
hai guys,
i am using FC6 and Gladeversion is 2.12.1
i am adding the mozillacomponent to gtkbuild frame.but its showing error.
what is the exact probelm?
i am submiting the code also
#include "gtkmozembed.h"
GtkWidget*
create_window1 (void)
{
GtkWidget *window1;
GtkWidget *fixed1;
GtkWidget *frame1;
GtkWidget *alignment1;
GtkWidget *content1;
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window1), _("window1"));
fixed1 = gtk_fixed_new ();
gtk_widget_show (fixed1);
gtk_container_add (GTK_CONTAINER (window1), fixed1);
frame1 = gtk_frame_new (NULL);
gtk_widget_show (frame1);
gtk_fixed_put (GTK_FIXED (fixed1), frame1, 0, 0);
gtk_widget_set_size_request (frame1, 400, 320);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);
content1 = GTK_MOZ_EMBED (gtk_moz_embed_new());
gtk_moz_embed_load_url(content1,"http://google.com");
gtk_container_add(GTK_CONTAINER(frame1), GTK_WIDGET(content1));
gtk_widget_show(GTK_WIDGET(content1));
alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment1);
gtk_container_add (GTK_CONTAINER (frame1), alignment1);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, "window1");
GLADE_HOOKUP_OBJECT (window1, fixed1, "fixed1");
GLADE_HOOKUP_OBJECT (window1, frame1, "frame1");
GLADE_HOOKUP_OBJECT (window1, alignment1, "alignment1");
return window1;
}
but compilation is good ,when i run the program it is showing fallowing warnings and finally got segmentation.
----------------------- warnings ------------
(browser:24476): GLib-GObject-WARNING **: specified instance size for type `GtkMozEmbed' is smaller than the parent type's `GtkBin' instance size
(browser:24476): GLib-GObject-WARNING **: specified instance size for type `GtkMozEmbed' is smaller than the parent type's `GtkBin' instance size
(browser:24476): Gtk-CRITICAL **: gtk_type_new: assertion `GTK_TYPE_IS_OBJECT (type)' failed
(browser:24476): Gtk-WARNING **: invalid cast from (NULL) pointer to `(unknown)'
** (browser:24476): CRITICAL **: file gtkmozembed2.cpp: line 854 (void gtk_moz_embed_load_url(GtkMozEmbed*, const char*)): assertion `embed != NULL' failed.
(browser:24476): Gtk-CRITICAL **: gtk_container_add: assertion `GTK_IS_WIDGET (widget)' failed
Segmentation fault
can u guide me na about this problem?why it is happening ? i have a dout this may be problem with glade 2.12.1?
thanks in advance
yours
Dennis |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 372 Location: State College, Pennsylvania
|
Posted: Fri Apr 27, 2007 12:58 pm Post subject: |
|
|
I'm not quite sure why you're getting these errors, but I can tell you when I've seen them before, which may help. When you derive a new GObject, you must include a non-pointer version of its parent object in the class. This allows the structures to actually physically build upon each other in memory. I'm assuming at some point in your code you should be passing a non-pointer version of the mozembed widget. If you pass a pointer, then its size will be that of a pointer, which will be smaller than its parent widget.
Also, if you are storing your mozembed widget as a GtkWidget, why are you casting it when it is initialized? |
|
| Back to top |
|
 |
dennisWonders Familiar Face
Joined: 20 Feb 2007 Posts: 12 Location: hyd
|
Posted: Sat Apr 28, 2007 10:39 am Post subject: not getting |
|
|
hi
thanks for ur reply
but i cannot understand ur response
can u explain clearly |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|