GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Jul 26, 2014 7:15 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Problem with glade 2.12.1?
PostPosted: Fri Apr 27, 2007 9:51 am 
Offline
Familiar Face

Joined: Tue Feb 20, 2007 6:04 am
Posts: 12
Location: hyd
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

_________________
werwrwer wer 45 45345tgdfgd f4534 rtertertert


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 12:58 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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?

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject: not getting
PostPosted: Sat Apr 28, 2007 10:39 am 
Offline
Familiar Face

Joined: Tue Feb 20, 2007 6:04 am
Posts: 12
Location: hyd
hi
thanks for ur reply

but i cannot understand ur response

can u explain clearly

_________________
werwrwer wer 45 45345tgdfgd f4534 rtertertert


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group