Closed rookiefront closed 4 years ago
gtk2 go1.4 go-gtk last
func main() { //初始化 gtk.Init(&os.Args) builder := gtk.NewBuilder() builder.AddFromFile("./1.3.ui") //获取glade 上面的控件 obj := builder.GetObject("window1") window := gtk.WidgetFromObject(obj) window.Show() window.Connect("destroy", gtk.MainQuit) gtk.Label callback.Init(builder) gtk.Main() }
<?xml version="1.0"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window1"> <property name="width_request">480</property> <property name="height_request">320</property> <property name="extension_events">cursor</property> <property name="title" translatable="yes">studyseo问答</property> <property name="window_position">center-on-parent</property> <property name="default_width">480</property> <property name="default_height">320</property> <property name="type_hint">dialog</property> <child> <object class="GtkFixed" id="fixed1"> <property name="visible">True</property> <child> <object class="GtkButton" id="button2"> <property name="label" translatable="yes">B2</property> <property name="width_request">100</property> <property name="height_request">80</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> </object> <packing> <property name="x">159</property> <property name="y">143</property> </packing> </child> </object> </child> </object> </interface>
Can you try _exmaple/builder ?
I need this control now Label
Label
I need tag label and set it
I'm sorry I didn't find him in the example.
The API doesn't seem to provide either
Thank you for your reply
gtk2 go1.4 go-gtk last