本文整理汇总了Golang中github.com/gotk3/gotk3/gtk.Box.PackStart方法的典型用法代码示例。如果您正苦于以下问题:Golang Box.PackStart方法的具体用法?Golang Box.PackStart怎么用?Golang Box.PackStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/gotk3/gotk3/gtk.Box
的用法示例。
在下文中一共展示了Box.PackStart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newUnifiedLayout
func newUnifiedLayout(ui *gtkUI, left, parent *gtk.Box) *unifiedLayout {
ul := &unifiedLayout{
ui: ui,
cl: &conversationList{},
leftPane: left,
itemMap: make(map[int]*conversationStackItem),
}
ul.cl.layout = ul
builder := newBuilder("UnifiedLayout")
builder.getItems(
"treeview", &ul.cl.view,
"liststore", &ul.cl.model,
"revealer", &ul.revealer,
"notebook", &ul.notebook,
"header_label", &ul.header,
"header_box", &ul.headerBox,
"close_button", &ul.close,
)
builder.ConnectSignals(map[string]interface{}{
"on_activate": ul.cl.onActivate,
"on_clicked": ul.onCloseClicked,
"on_switch_page": ul.onSwitchPage,
})
parent.PackStart(ul.revealer, false, true, 0)
parent.SetChildPacking(left, false, true, 0, gtk.PACK_START)
ul.notebook.SetSizeRequest(500, -1)
ul.revealer.Hide()
left.SetHAlign(gtk.ALIGN_FILL)
left.SetHExpand(true)
return ul
}
示例2: setupTextView
// Setup the TextView, put it in a ScrolledWindow, and add both to box.
func setupTextView(box *gtk.Box) *gtk.TextView {
sw, _ := gtk.ScrolledWindowNew(nil, nil)
tv, _ := gtk.TextViewNew()
sw.Add(tv)
box.PackStart(sw, true, true, 0)
return tv
}
示例3: setupPropertyCheckboxes
func setupPropertyCheckboxes(tv *gtk.TextView, outer *gtk.Box, props []*BoolProperty) {
box, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0)
for _, prop := range props {
chk, _ := gtk.CheckButtonNewWithLabel(prop.Name)
// initialize the checkbox with the property's current value
chk.SetActive(prop.Get())
p := prop // w/o this all the checkboxes will toggle the last property in props
chk.Connect("toggled", func() {
p.Set(chk.GetActive())
})
box.PackStart(chk, true, true, 0)
}
outer.PackStart(box, false, false, 0)
}
示例4: CreateDialog
func (dialog *EditMenuDialog) CreateDialog(extra *gtk.Widget) (err error) {
d := dialog.dialog
d.SetTitle("New Element")
var active string
active, err = dialog.fts.GetValueById(dialog.fts.GetCurrentId())
if err != nil {
return
}
var box *gtk.Box
box, err = d.GetContentArea()
if err != nil {
return
}
activeText, err := gtk.LabelNew(fmt.Sprintf("%s", active))
if err != nil {
return
}
activeLayoutBox, err := createLabeledRow("Active element:", &activeText.Widget)
if err != nil {
return
}
box.PackStart(activeLayoutBox, false, false, 6)
if extra != nil {
box.PackStart(extra, false, false, 6)
}
dialog.stack, err = gtk.StackNew()
if err != nil {
return
}
err = dialog.fillStack()
if err != nil {
return
}
box.PackStart(dialog.stack, true, true, 6)
d.AddButton("Cancel", gtk.RESPONSE_CANCEL)
d.AddButton("OK", gtk.RESPONSE_OK)
d.SetDefaultResponse(gtk.RESPONSE_OK)
d.ShowAll()
return
}