當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。