GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 7:59 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Glade+GtkBuilder+grids
PostPosted: Mon Jun 09, 2014 12:50 pm 
Offline

Joined: Sun Jun 08, 2014 7:49 pm
Posts: 2
hello,

as a first try on Gtk, i installed libgtk-3-dev and libglademm-2.4-dev

i use glade (3.14.2) and i try to load a layout with the following code

Code:
#include <gtkmm.h>

int main(int argc, char** argv)
{

    Gtk::Main kit(argc, argv);
   
    Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_file("layout.glade");

}


it works but i get errors once i add grids

"terminate called after throwing an instance of Gtk::BuildError"

here is the layout :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <!-- interface-requires gtk+ 3.0 -->
  <object class="GtkWindow" id="window1">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkGrid" id="grid1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
        <child>
          <placeholder/>
        </child>
      </object>
    </child>
  </object>
</interface>


how can i have a more detailled description of what went wrong ?

thx


Top
 Profile  
 
 Post subject: Re: Glade+GtkBuilder+grids
PostPosted: Tue Jun 10, 2014 6:18 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
Hello,

I have tried your code and got no errors. I am using GTK v3.12 and have Glade v3.18, so you may want to up-grade your packages just in case that is a bug in the version of GTK you are using.

Also you do not need libglademm-2.4-dev. This was for GTK v2 before it used GTK Builder. Linking both GTK v2 and v3 may cause problems with your code.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Glade+GtkBuilder+grids
PostPosted: Tue Jun 10, 2014 1:46 pm 
Offline

Joined: Sun Jun 08, 2014 7:49 pm
Posts: 2
Thank you, I'll have a look.


Last edited by zerohour on Tue Jun 10, 2014 3:21 pm, edited 1 time in total.
Removed SMS, No need to quote previous post.


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: Google [Bot] and 5 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