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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…