當前位置: 首頁>>代碼示例>>Golang>>正文


Golang xc.XRunXCGUI函數代碼示例

本文整理匯總了Golang中github.com/codyguo/xcgui/xc.XRunXCGUI函數的典型用法代碼示例。如果您正苦於以下問題:Golang XRunXCGUI函數的具體用法?Golang XRunXCGUI怎麽用?Golang XRunXCGUI使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了XRunXCGUI函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: main

func main() {
	xcgui.XInitXCGUI()
	hwnd := xcgui.XWndCreate(400, 200, 300, 200, "標題",
		xcgui.NULL, xcgui.XC_WINDOW_STYLE_DEFAULT)

	parent := xcgui.HXCGUI(hwnd)
	//button
	btn := xcgui.XBtnCreate(10, 5, 80, 22, "關閉", parent)
	xcgui.XBtnSetType(btn, xcgui.BUTTON_TYPE_CLOSE)
	//監聽btn事件
	xcgui.XEleRegEventC(btn, xcgui.XE_BNCLICK, syscall.NewCallback(OnBtnClick))
	//label
	lb := xcgui.XShapeTextCreate(50, 100, 100, 22, "hello world!", parent)
	xcgui.XShapeTextSetText(lb, "hello 世界!")
	xcgui.XShapeTextSetTextColor(lb, 0xff0000, 255)

	//取text及長度
	str := xcgui.XShapeTextGetTextGo(lb)
	fmt.Println(str)
	fmt.Println(xcgui.XShapeTextGetTextLength(lb))

	xcgui.XWndShowWindow(hwnd, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:henrylee2cn,項目名稱:xcgui,代碼行數:25,代碼來源:hello.go

示例2: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 350, 400, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hTree := xcgui.XTree_Create(20, 40, 300, 300, xcgui.HXCGUI(hWindow))
	xcgui.XTree_SetItemTemplateXML(hTree, "../xml-template/Tree_Item.xml")

	hAdapter := xcgui.XAdapterTree_Create()
	xcgui.XTree_BindAdapter(hTree, hAdapter)
	xcgui.XAdapterTree_AddColumn(hAdapter, "name")

	for i := 0; i < 20; i++ {
		xcgui.XAdapterTree_InsertItemText(hAdapter, "name-"+fmt.Sprint(i)+"-0", xcgui.XC_ID_ROOT, xcgui.XC_ID_LAST)
	}

	xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----1", 1, xcgui.XC_ID_LAST)         // idc1
	idc2 := xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----2", 1, xcgui.XC_ID_LAST) // idc2
	xcgui.XAdapterTree_InsertItemText(hAdapter, "Item1-----2--1", idc2, xcgui.XC_ID_LAST)   // idc2-1

	xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_SELECT, xcgui.CallBack(OnTreeSelect))
	xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_EXPAND, xcgui.CallBack(OnTreeExpand))

	xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_CREATE, xcgui.CallBack(OnTemplateCreate))
	xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_DESTROY, xcgui.CallBack(OnTemplateDestroy))
	xcgui.XEle_RegEventC(hTree, xcgui.XE_TREE_TEMP_ADJUST_COORDINATE, xcgui.CallBack(OnTemplateAdjustCoordinate))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:30,代碼來源:tree.go

示例3: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	info := new(my_image_info)

	info.hImage1 = xcgui.XImage_LoadFile("../../img/1.png", false)
	info.hImage2 = xcgui.XImage_LoadFile("../../img/2.png", false)
	info.hImage3 = xcgui.XImage_LoadFile("../../img/3.png", false)
	info.hImage4 = xcgui.XImage_LoadFile("../../img/4.png", false)
	info.hImage5 = xcgui.XImage_LoadFile("../../img/5.png", false)
	info.hImage6 = xcgui.XImage_LoadFile("../../img/6.png", false)

	left, top := 20, 50
	for i := 0; i < 5; i++ {
		CreateButton(left, top, info, hWindow)
		left += 50
	}

	left, top = 20, 100
	for i := 0; i < 5; i++ {
		CreateButtonLoop(left, top, info, hWindow)
		left += 50
	}

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()

}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:30,代碼來源:animation.go

示例4: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 400, 300, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	// hShapeLine
	xcgui.XShapeLine_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow))
	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:10,代碼來源:shapeLine.go

示例5: main

func main() {
	xcgui.XCLoadResource("resource.xml", "")

	hxCGUI := xcgui.XCLoadLayout("layout.xml", 0)

	xcgui.XWndAdjustLayout(xcgui.HWINDOW(hxCGUI))
	xcgui.XWndShowWindow(xcgui.HWINDOW(hxCGUI), xcgui.SW_SHOW)

	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:henrylee2cn,項目名稱:xcgui,代碼行數:11,代碼來源:ui.go

示例6: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(10, 5, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE)

	xcgui.XEle_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)

	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:11,代碼來源:element.go

示例7: main

func main() {
	hWindow = xcgui.XWnd_Create(0, 0, 0, 0, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_NOTHING)

	// We load our icon from a file.
	icon, err := walk.NewIconFromFile("../../img/x.ico")
	if err != nil {
		log.Fatal(err)
	}

	// Create the notify icon and make sure we clean it up on exit.
	ni, err = walk.NewNotifyIcon()
	if err != nil {
		log.Fatal(err)
	}
	defer ni.Dispose()

	// Set the icon and a tool tip text.
	if err := ni.SetIcon(icon); err != nil {
		log.Fatal(err)
	}
	if err := ni.SetToolTip("托盤"); err != nil {
		log.Fatal(err)
	}

	// When the left mouse button is pressed, bring up our balloon.
	ni.MouseDown().Attach(func(x, y int, button walk.MouseButton) {
		if button == walk.LeftButton {
			if err := ni.ShowCustom(
				"自定義消息",
				"這是一個帶圖標的自定義消息."); err != nil {
				log.Fatal(err)
			}
		} else {
			RunXCMenu()
		}

	})

	// 托盤圖標默認為隱藏狀態,需設置為顯示。
	if err := ni.SetVisible(true); err != nil {
		log.Fatal(err)
	}

	// Now that the icon is visible, we can bring up an info balloon.
	if err := ni.ShowInfo("托盤", "正在運行中."); err != nil {
		log.Fatal(err)
	}

	// 注冊菜單選擇事件
	xcgui.XWnd_RegEventC(hWindow, xcgui.XWM_MENU_SELECT, xcgui.CallBack(OnWndMenuSelect))

	// Run the message loop.
	xcgui.XRunXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:54,代碼來源:notifyicon.go

示例8: main

func main() {
	hWindow = xcgui.XWnd_Create(100, 100, 400, 300, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.XBtn_SetType(xcgui.XBtn_Create(5, 3, 60, 20, "Close", xcgui.HXCGUI(hWindow)), xcgui.BUTTON_TYPE_CLOSE)

	hButton := xcgui.XBtn_Create(20, 50, 120, 20, "popu-modalWindow", xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClick))
	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)

	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:11,代碼來源:modal.go

示例9: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 400, 400, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hPicture := xcgui.XShapePic_Create(20, 50, 100, 100, xcgui.HXCGUI(hWindow))
	xcgui.XShapePic_SetImage(hPicture, xcgui.XImage_LoadFile("../img/comma_face_02.png", false))

	xcgui.XWnd_AdjustLayout(hWindow)
	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:12,代碼來源:shapePicture.go

示例10: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 400, 300, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hEle := xcgui.XEle_Create(60, 60, 200, 200, xcgui.HXCGUI(hWindow))
	hTextBlock := xcgui.XShapeText_Create(0, 0, 100, 20, "123456", xcgui.HXCGUI(hEle))

	xcgui.XShapeText_SetLayoutWidth(hTextBlock, xcgui.LAYOUT_SIZE_TYPE_AUTO, 0)
	xcgui.XShapeText_SetLayoutHeight(hTextBlock, xcgui.LAYOUT_SIZE_TYPE_AUTO, 0)

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:14,代碼來源:shapeText.go

示例11: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 300, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hSBar1 := xcgui.XSBar_Create(20, 50, 200, 20, xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hSBar1, xcgui.XE_SBAR_SCROLL, xcgui.CallBack(OnSBarScroll))

	hSBar2 := xcgui.XSBar_Create(230, 50, 20, 200, xcgui.HXCGUI(hWindow))
	xcgui.XSBar_SetHorizon(hSBar2, false)

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:14,代碼來源:scrollBar.go

示例12: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 200, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hSliderBar := xcgui.XSliderBar_Create(20, 40, 260, 60, xcgui.HXCGUI(hWindow))
	xcgui.XSliderBar_SetRange(hSliderBar, 10)
	xcgui.XSliderBar_SetButtonHeight(hSliderBar, 27)
	xcgui.XSliderBar_SetButtonWidth(hSliderBar, 27)
	xcgui.XSliderBar_SetSpaceTwo(hSliderBar, 10, 10)

	xcgui.XEle_RegEventC(hSliderBar, xcgui.XE_SLIDERBAR_CHANGE, xcgui.CallBack(OnSliderBarChange))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()

}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:17,代碼來源:sliderBar.go

示例13: main

func main() {
	mw := new(MyMainWindow)

	mw.hWindow = xcgui.XWnd_Create(0, 0, 800, 600, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(mw.hWindow)

	hButton := xcgui.XBtn_Create(50, 100, 100, 30, "瀏覽圖片", xcgui.HXCGUI(mw.hWindow))
	hButtonAbout := xcgui.XBtn_Create(200, 100, 100, 30, "關於", xcgui.HXCGUI(mw.hWindow))

	xcgui.XEle_RegEventC1(hButton, xcgui.XE_BNCLICK, xcgui.CallBack(mw.openAction_Triggered))
	xcgui.XEle_RegEventC1(hButtonAbout, xcgui.XE_BNCLICK, xcgui.CallBack(mw.aboutAction_Triggered))

	xcgui.XWnd_ShowWindow(mw.hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()

}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:17,代碼來源:imageviewer.go

示例14: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 300, 300, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hScrollView := xcgui.XSView_Create(20, 50, 200, 200, xcgui.HXCGUI(hWindow))
	xcgui.XSView_SetTotalSize(hScrollView, 300, 300)

	xcgui.XBtn_Create(10, 10, 100, 20, "Button1", xcgui.HXCGUI(hScrollView))
	xcgui.XBtn_Create(10, 40, 100, 20, "Button2", xcgui.HXCGUI(hScrollView))
	xcgui.XBtn_Create(10, 70, 100, 20, "Button3", xcgui.HXCGUI(hScrollView))

	xcgui.XEle_RegEventC(hScrollView, xcgui.XE_SCROLLVIEW_SCROLL_H, xcgui.CallBack(OnScrollViewScrollH))
	xcgui.XEle_RegEventC(hScrollView, xcgui.XE_SCROLLVIEW_SCROLL_V, xcgui.CallBack(OnScrollViewScrollV))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:18,代碼來源:scrollView.go

示例15: main

func main() {
	hWindow := xcgui.XWnd_Create(0, 0, 500, 400, "炫彩界麵庫窗口", 0, xcgui.XC_WINDOW_STYLE_DEFAULT)
	xcgui.CloseBtn(hWindow)

	hListBox = xcgui.XListBox_Create(20, 40, 300, 310, xcgui.HXCGUI(hWindow))
	xcgui.XListBox_SetItemTemplateXML(hListBox, "../xml-template/ListBox_Item.xml")
	xcgui.XSView_SetLineSize(hListBox, 20, 20)

	hAdapter := xcgui.XAdapterTable_Create()
	xcgui.XListBox_BindAdapter(hListBox, hAdapter)
	xcgui.XAdapterTable_AddColumn(hAdapter, "name")
	xcgui.XAdapterTable_AddColumn(hAdapter, "name2")
	xcgui.XAdapterTable_AddColumn(hAdapter, "name3")

	for i := 0; i < 20; i++ {
		index := xcgui.XAdapterTable_AddItemTextEx(hAdapter, "name", "item-"+fmt.Sprint(i))
		if index != xcgui.XC_ID_ERROR {
			xcgui.XAdapterTable_SetItemTextEx(hAdapter, index, "name2", "item-1-"+fmt.Sprint(i))
			xcgui.XAdapterTable_SetItemTextEx(hAdapter, index, "name3", "item-2-"+fmt.Sprint(i))
		}
	}

	hButton1 := xcgui.XBtn_Create(330, 40, 150, 18, "插入", xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hButton1, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClickAdd))

	hButton2 := xcgui.XBtn_Create(330, 60, 150, 18, "刪除", xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hButton2, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClickDel))

	hButton3 := xcgui.XBtn_Create(330, 84, 150, 18, "刪除 index=(1-3)", xcgui.HXCGUI(hWindow))
	xcgui.XEle_RegEventC(hButton3, xcgui.XE_BNCLICK, xcgui.CallBack(OnBtnClickDelEx))

	hRichEidt = xcgui.XRichEdit_Create(330, 106, 120, 200, xcgui.HXCGUI(hWindow))
	xcgui.XSView_ShowSBarV(hRichEidt, true)
	xcgui.XRichEdit_EnableMultiLine(hRichEidt, true)

	xcgui.XEle_RegEventC(hListBox, xcgui.XE_LISTBOX_TEMP_CREATE_END, xcgui.CallBack(OnTemplateCreate))
	xcgui.XEle_RegEventC(hListBox, xcgui.XE_LISTBOX_TEMP_DESTROY, xcgui.CallBack(OnTemplateDestroy))
	xcgui.XEle_RegEventC(hListBox, xcgui.XE_LISTBOX_TEMP_ADJUST_COORDINATE, xcgui.CallBack(OnTemplateAdjustCoordinate))
	xcgui.XEle_RegEventC(hListBox, xcgui.XE_LISTBOX_SELECT, xcgui.CallBack(OnListBoxSelect))

	xcgui.XWnd_ShowWindow(hWindow, xcgui.SW_SHOW)
	xcgui.XRunXCGUI()
	xcgui.XExitXCGUI()
}
開發者ID:CodyGuo,項目名稱:xcgui,代碼行數:44,代碼來源:listBox.go


注:本文中的github.com/codyguo/xcgui/xc.XRunXCGUI函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。