dontpanic92 / wxGo

Golang wxWidgets Wrapper
Other
403 stars 51 forks source link

Best way to make popup dialogs? #51

Open alanbaumgartner opened 6 years ago

alanbaumgartner commented 6 years ago

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 commented 6 years ago

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.

dontpanic92 commented 6 years ago

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.