Documentation ¶
Index ¶
- func DialogError(window *gtk.Window, title, text string, err error, options ...bool) bool
- func DialogMessage(window *gtk.Window, parameters ...interface{}) (value int)
- func DialogMessageOptNew() *dlgOptions
- type AboutInfos
- type DialogBoxStructure
- func (dbs *DialogBoxStructure) BringToFront()
- func (dbs *DialogBoxStructure) DialogBoxInit(window *gtk.Window, widget gtk.IWidget, title string, buttons ...string)
- func (dbs *DialogBoxStructure) GetPosition() (posX, posY int)
- func (dbs *DialogBoxStructure) GetSize() (width, height int)
- func (dbs *DialogBoxStructure) Run() (value int)
- func (dbs *DialogBoxStructure) RunNonModal(respCallBack ...func(dlg *gtk.Dialog, response int))
- func (dbs *DialogBoxStructure) SetPosition(posX, posY int)
- func (dbs *DialogBoxStructure) SetSize(width, height int)
- type DlgOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialogError ¶
DialogError: Display error messaged dialog returning true in error case. options: devMode, forceExit, markupEnabled bool NOTICE: exit option must not be used if a "defer" function is initiated !
func DialogMessage ¶
DlgMessage: Display message dialog with multiples buttons. return get <0 for cross closed or >-1 correspondig to buttons order representation. dlgType accepte: "info", "warning", "question", "error", "other", by adding 'DlgOptions' type flags. 'parameters' must be in order: (title, text, iconFileName, options, buttons..., callBackResp) 'iconFileName' can be a []byte or a string, "" or nil -> default image. 'buttons' must be comma separated buttons names: "Cancel", "Ok", "Exit"... 'callBackResp' is used for non-modal dialog message in form of: func(resp int), this function is required (even if it is not used), at the tail of the parameters if the 'DLG_NON_MODAL' flag is set, this function permit to retrieve the response value.
func DialogMessageOptNew ¶
func DialogMessageOptNew() *dlgOptions
Types ¶
type AboutInfos ¶
type AboutInfos struct { TitleWindow, AppName, AppVers, AppCreats, YearCreat, LicenseAbrv, LicenseShort, Repository, CssName, Description string ImageTop, ImageOkButton interface{} ImageTopHeight, MaxCharWidthText, ImageOkButtonSize, Width, HttpKeepFromEnd, Height int Resizable, KeepAbove bool DlgBoxStruct *DialogBoxStructure // contains filtered or unexported fields }
func AboutInfosNew ¶
func AboutInfosNew(parentWindow *gtk.Window) *AboutInfos
func (*AboutInfos) FillInfos ¶
func (ab *AboutInfos) FillInfos(titleWindow, appName, appVers, appCreat, yearCreat, licenseAbrv, licenseShort, repository, description string, topImage, okBtnIcon interface{})
InitFillInfos: Initialize structure
func (*AboutInfos) InitFillInfos ¶
func (ab *AboutInfos) InitFillInfos(parentWindow *gtk.Window, titleWindow, appName, appVers, appCreat, yearCreat, licenseAbrv, licenseShort, repository, description string, topImage, okBtnIcon interface{})
InitFillInfos: Initialize structure
type DialogBoxStructure ¶
type DialogBoxStructure struct { BoxHAlign, BoxVAlign gtk.Align BoxOrientation gtk.Orientation BoxHExpand, BoxVExpand, WidgetExpend, SkipTaskbarHint, KeepAbove, Resizable, ScrolledArea, WidgetFill, MarkupLabel, LabelLineWrap bool Padding uint Response, IconsSize int Title, Text, CssName string Buttons []string ButtonsImages []interface{} // image representation from file or []byte, depending on type Dialog *gtk.Dialog ButtonReliefStyle gtk.ReliefStyle Widgets []gtk.IWidget WidgetsProps gitsws.WidgetProperties // each property applyed to each object // Widgets below will be added after scrolled window without any property, // they must be applyed mlanually on creation by the caller (useful to add // some checkboxes or others after a TreeView). WidgetsOutOfScrolledArea []gtk.IWidget // Function used when a button is clicked or window is closed // This public function is wrapped with "internalResponseCallBack" ResponseCallBack func(dlg *gtk.Dialog, response int) // contains filtered or unexported fields }
DialogBoxStructure: Wrap a Dialog with desired count of buttons and widgets. The structure have defaults parameters
func DialogBoxNew ¶
func DialogBoxNew(window *gtk.Window, widget gtk.IWidget, title string, buttons ...string) *DialogBoxStructure
DialogBoxNew: Create a new structure to wrap a GtkDialog including defaults parameters. "widget" can be "nul" to only display "text".
func (*DialogBoxStructure) BringToFront ¶
func (dbs *DialogBoxStructure) BringToFront()
BringToFront: Set window position to be over all others windows without staying on top whether another window come to be selected.
func (*DialogBoxStructure) DialogBoxInit ¶
func (*DialogBoxStructure) GetPosition ¶
func (dbs *DialogBoxStructure) GetPosition() (posX, posY int)
GetPosition:
func (*DialogBoxStructure) GetSize ¶
func (dbs *DialogBoxStructure) GetSize() (width, height int)
GetSize:
func (*DialogBoxStructure) Run ¶
func (dbs *DialogBoxStructure) Run() (value int)
Run: function return "value" < 0 for cross closed or >= 0 corresponding to buttons order representation starting with 0 at left. The dialog is destroyed at the end of process. Only the Modal Dialog window is allowed with this function. Use RunForResults() to allow non Modal usage.
func (*DialogBoxStructure) RunNonModal ¶
func (dbs *DialogBoxStructure) RunNonModal(respCallBack ...func(dlg *gtk.Dialog, response int))
RunNonModal: allow non modal Dialog "respCallBack()" is executed on button click or exit window
func (*DialogBoxStructure) SetPosition ¶
func (dbs *DialogBoxStructure) SetPosition(posX, posY int)
SetPosition:
func (*DialogBoxStructure) SetSize ¶
func (dbs *DialogBoxStructure) SetSize(width, height int)
SetSize:
type DlgOptions ¶
type DlgOptions int
const ( DLG_NON_MODAL DlgOptions = 1 << iota DLG_MARKUP DLG_BTN_RELIEF_NONE DLG_INFO DLG_WARNING DLG_QUESTION DLG_ERROR DLG_OTHER )