当前位置: 首页>>代码示例>>Golang>>正文


Golang gtk.Box类代码示例

本文整理汇总了Golang中github.com/gotk3/gotk3/gtk.Box的典型用法代码示例。如果您正苦于以下问题:Golang Box类的具体用法?Golang Box怎么用?Golang Box使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Box类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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
}
开发者ID:adrien3d,项目名称:gobox,代码行数:8,代码来源:boolprops.go

示例2: setCurrentNotification

func (account *account) setCurrentNotification(ib *gtk.InfoBar, notificationArea *gtk.Box) {
	account.Lock()
	defer account.Unlock()

	account.removeCurrentNotification()
	account.currentNotification = ib
	notificationArea.Add(ib)
	ib.ShowAll()
}
开发者ID:tanujmathur,项目名称:coyim,代码行数:9,代码来源:account.go

示例3: fillBox

// Collect all input elements to be constructed.
func (dialog *EditMenuDialog) fillBox(box *gtk.Box, e elementType) error {
	for _, i := range inputElementMap[e] {
		widget, err := dialog.createInputElement(i)
		if err != nil {
			return err
		}
		box.Add(widget)
	}
	return nil
}
开发者ID:axel-freesp,项目名称:sge,代码行数:11,代码来源:editmenudialog.go

示例4: 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
}
开发者ID:VKCheung,项目名称:coyim,代码行数:33,代码来源:unified.go

示例5: 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)
}
开发者ID:adrien3d,项目名称:gobox,代码行数:14,代码来源:boolprops.go

示例6: 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
}
开发者ID:axel-freesp,项目名称:sge,代码行数:46,代码来源:editmenudialog.go


注:本文中的github.com/gotk3/gotk3/gtk.Box类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。