Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the following HdyClamp declaration in a .ui file. HdyClamp is defined in the libhandy api. see here

 .......

 <object class="HdyClamp" id="cl">
            <property name="visible">True</property>
            <property name="can-focus">False</property>
            <child>
 .......

Since HdyClamp is also a GtkWidget, I thought I should be able to get this object through GtkBuilder and store it in a GtkWidget object. Here is the code.

 GtkWidget * clamp = GTK_WIDGET(gtk_builder_get_object(builder, "cl"));

Where builder is a GtkBuilder object associated with the .ui file. The result is that clamp is NULL after that line which means gtk_builder_get_object() failed to return the HdyClamp object with the given ID cl. I am really not sure why this happens and would greatly appreciate the help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.7k views
Welcome To Ask or Share your Answers For Others

1 Answer

The issue is fixed, see the comments under the post.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...