wxGo icon indicating copy to clipboard operation
wxGo copied to clipboard

Best way to make popup dialogs?

Open alanbaumgartner opened this issue 7 years ago • 2 comments
trafficstars

Hello!

I am fairly unfamiliar with wx in general and have looked around a decent bit but I am currently have my main application as a wx.Frame and I want to have a popup window where I can edit the settings.

Is the best or most accepted way to do this a wx.Dialog? If so, how should I structure it?

This is what I am currently using and it doesn't feel correct.

type Client struct {
	wx.Frame
	statusbar wx.StatusBar
	menubar   wx.MenuBar
	listenBtn    wx.Button
	saveDialog SaveDialog
}

type SaveDialog struct {
	wx.Dialog
	hostCtrl wx.TextCtrl
	portCtrl wx.TextCtrl
	saveBtn wx.Button
	loadBtn wx.Button
}

From the save dialog I take the hostCtrl and portCtrl's text fields and save/load them with a JSON file.

alanbaumgartner avatar Mar 19 '18 03:03 alanbaumgartner

I have found popup menus after reading most of wx documention. Is there anything like godocs for wxGo I could read too?

I will leave this open so you can see my second question but can be closed whenever!

Thanks.

alanbaumgartner avatar Mar 19 '18 10:03 alanbaumgartner

To be honest - No. Documentation is definitely a shortage of wxGo. But fortunately, wxGo is no more than a wrapper, so in most cases you can find the answer through reading wxWidgets' doc, having a check on the examples, etc. If you have any questions, welcome to open an issue.

dontpanic92 avatar Mar 19 '18 11:03 dontpanic92