GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

execution error: gtk_widget_show problem for newb

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
iansane
Familiar Face


Joined: 07 Aug 2008
Posts: 6

PostPosted: Thu Aug 07, 2008 11:51 pm    Post subject: execution error: gtk_widget_show problem for newb Reply with quote

Hi,

This is my firs post so hello everyone and thanks for helping out with problems here.

I am following the tutorial to make GTK+ text editor in gtk-glade-tutorial-part-3 by Micha Carrick. I tried including the url but the forum won't let me since this is my first post. SPAM protection I'm guessing.

I got it compiled after fixing a few of my typos but when I try to execute it I get this error message:

(tutorial:13058): Gtk-CRITICAL **: gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed


In the turorial it says I will get another warning but it should still run.

Any ideas why I got the error?

Thanks
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 505
Location: Portland, OR USA

PostPosted: Fri Aug 08, 2008 1:05 am    Post subject: Reply with quote

Yeah, I have to moderate the comments on my website and I've been pretty busy with my "day job".

Can you post the code you typed (did you try copying pasting my code) and the first few lines of the XML file here. From there I could help you learn how to troubleshoot something like that.
Back to top
iansane
Familiar Face


Joined: 07 Aug 2008
Posts: 6

PostPosted: Fri Aug 08, 2008 1:25 am    Post subject: re:post subject Reply with quote

Hi Mr. Carrick

I copy and pasted the second time to make sure I wasn't missing a typo but I got the same error and no window. Below is the first few lines of the xml as you requeted. Thanks for your help.

Wait! you just gave me a clue and I found that in xml it was ID=window1 instead of ID=window which is what gets called from the c file. Sorry I didn't think to look back into the xml. I won't forget that next time.

At this point should it be just showing a very small window with no menu, status bar, or text area? The xml is not very long. Here it is.

Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11

<?xml version="1.0"?>
<!--Generated with glade3 3.4.5 on Thu Aug  7 16:26:15 2008 -->
<interface>
  <object class="GtkWindow" id="window">
    <child>
      <placeholder/>
    </child>
  </object>
</interface>
Back to top
iansane
Familiar Face


Joined: 07 Aug 2008
Posts: 6

PostPosted: Fri Aug 08, 2008 2:22 am    Post subject: now problems are worse Reply with quote

I decided to delete and start from scratch. For some reason I can't convert the tutorial.glade to tutorial.xml now

Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

ian@lotus-control:~/Desktop/gladetutorial1$ gtk-builder-convert tutorial.glade tutorial.xml
Traceback (most recent call last):
  File "/usr/bin/gtk-builder-convert", line 745, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/gtk-builder-convert", line 733, in main
    conv.parse_file(input_filename)
  File "/usr/bin/gtk-builder-convert", line 161, in parse_file
    self._parse()
  File "/usr/bin/gtk-builder-convert", line 259, in _parse
    self._convert(node.getAttribute("class"), node)
  File "/usr/bin/gtk-builder-convert", line 284, in _convert
    self._convert_menu(node)
  File "/usr/bin/gtk-builder-convert", line 342, in _convert_menu
    item = self._convert_menuitem(uimgr, obj_node)
  File "/usr/bin/gtk-builder-convert", line 378, in _convert_menuitem
    item = self._convert_menuitem(uimgr, obj_node)
  File "/usr/bin/gtk-builder-convert", line 374, in _convert_menuitem
    self._add_action_from_menuitem(uimgr, obj_node)
  File "/usr/bin/gtk-builder-convert", line 425, in _add_action_from_menuitem
    properties['stock_id'] = child
UnboundLocalError: local variable 'child' referenced before assignment


I don't know what could have happened to change things. I haven't done anything since I converted the first time.

I'll try to start over again tomorrow and see if I missed something again.

I'm runnung Ubuntu 8.04 AMD64 so maybe that is causeing problems. If so I'll set up a VM with 32 bit and try again later. I'll check back in case you see something I'm missing.

Thanks
Back to top
iansane
Familiar Face


Joined: 07 Aug 2008
Posts: 6

PostPosted: Fri Aug 08, 2008 3:44 am    Post subject: fixed. It was the bug in editing the menu that you mention Reply with quote

OK, sorry for all the trouble.

I don't know why it converted the file the first time without throwing an error.

I went in and made the changes to all menu items and then the conversion, compilation, and execution worked perfectly. I thought by the tutorial that I was not supposed to mess with the items under edit and help yet. Maybe I missread. Anyway I got the warnings you said I'll get and the window ran. I guess now it's time for me to figure out how to add commands to the menu items so they will do something.

Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP