Documentation ¶
Index ¶
- Constants
- Variables
- func ColorChooserDialogAndGetFloat64Val(parentWindow *gtk.Window, title string, orgCol []float64) (outFloat64 []float64, outStr string)
- func FileChooser(window *gtk.Window, dlgType, title, filename string, options ...bool) (outFilename string, result bool, err error)
- func FileChooserN(window *gtk.Window, title, filename string, options fcOpt) (outFilename string, result bool, err error)
- func FileChooserOptionsNew() *fcOptions
- type Calendar
- type CalendarData
- func (calData *CalendarData) FromLayout(in string) (err error)
- func (calData *CalendarData) FromTime(inTime time.Time)
- func (calData *CalendarData) Init(t ...time.Time)
- func (calData *CalendarData) ToCalData(cal *Calendar)
- func (calData *CalendarData) ToCalendar(cal *Calendar)
- func (calData *CalendarData) ToLayout() (out string)
- func (calData *CalendarData) ToTime() (outTime time.Time)
- func (calData *CalendarData) ToTimeAsUTC() (outTime time.Time)
Constants ¶
const ( FC_DLG_DEFAULT fcOpt = 1 << iota FC_DLG_SEL_FLD FC_DLG_CREATE_FLD FC_DLG_OPEN FC_DLG_OPEN_ENTRY // Open with 'entry', like in 'save' dialog FC_DLG_SAVE FC_NOT_ASK_OVERWRITE FC_NOT_KEEP_ABOVE FC_PREVIEW FC_NOT_MODAL FC_MULTI_SELECT FC_NOT_LOCAL_ONLY )
Variables ¶
var (
UserAbortError = errors.New("Action aborted by user !")
)
***************************
- FileChooser implementation. ***************************
Functions ¶
func ColorChooserDialogAndGetFloat64Val ¶
func ColorChooserDialogAndGetFloat64Val(parentWindow *gtk.Window, title string, orgCol []float64) (outFloat64 []float64, outStr string)
ColorChooserDialogAndGetHexValue: Open color chooser dialog and retrieve value. String return is converted like this: "rgb(239,41,41)" to "#EF2929".
func FileChooser ¶
func FileChooser(window *gtk.Window, dlgType, title, filename string, options ...bool) (outFilename string, result bool, err error)
FileChooser: Display a file chooser dialog. dlgType: "open", "save", "create-folder", "select-folder" as dlgType. title = "": auto choice based on dialog type. options: 1-keepAbove, 2-enablePreviewImages, 3-setModal, 4-askOverwrite Default: 1- true, 2- false, 3- true, 4- true
func FileChooserN ¶
func FileChooserN(window *gtk.Window, title, filename string, options fcOpt) (outFilename string, result bool, err error)
FileChooser: Display a file chooser dialog box.
By default, 'keepAbove', 'setModal', 'askOverwrite' are enabled. title = "": auto choice based on dialog type.
Parameters: title, filename string, options fcOpt where 'options' means: 'dlgType' as FC_DLG_XXX and FC_XXX for dialog options. i.e: "title dialog", "/home/user/.config/x.txt", FC_DLG_SAVE|FC_ASK_OVERWRITE|FC_MODAL' means open a saving dialog, ask for overwrite and set it as modal dialog.
NOTE: 'FileChooserOptionsNew' gives a structure which contains all the available options and can be declared as a global variable and then used whenever needed.
func FileChooserOptionsNew ¶
func FileChooserOptionsNew() *fcOptions
FileChooserOptionsNew: create a new structure containing the available options/dialogType used as the parameters for the 'FileChooserN' function.
Types ¶
type Calendar ¶
type Calendar struct { TitleWindow string ImageTop interface{} LabelHour string ButtonsImages []interface{} ButtonsLabels []string ButtonsSize int ButtonOkPosition int // Specify the position of the "validate" button (start at 0 from left) Width int Height int Resizable bool KeepAbove bool Result *CalendarData DisplayTime bool // contains filtered or unexported fields }
This structure and methods give a convenient way to display and use a calendar window to setting and retrieving calendar values.
func CalendarNew ¶
func CalendarNew(parentWindow *gtk.Window, calData *CalendarData, titleWindow string, topImage interface{}, buttons []string, imagesButtons ...interface{}) *Calendar
CalendarNew: create new structure and initialize it.
type CalendarData ¶
type CalendarData struct { Year, Month, Day, Hour, Min, Sec int BlankTime time.Time // Used when no time is defined // contains filtered or unexported fields }
func CalendarDataNew ¶
func CalendarDataNew() (calData *CalendarData)
CalendarDataNew: create a new calendarData structure
func (*CalendarData) FromLayout ¶
func (calData *CalendarData) FromLayout(in string) (err error)
FromLayout: build CalendarData using this layout: "2006.01.02.15.04.05"
func (*CalendarData) Init ¶
func (calData *CalendarData) Init(t ...time.Time)
Init: set values relatives "t" or time.Time{} if not specified.
func (*CalendarData) ToCalData ¶
func (calData *CalendarData) ToCalData(cal *Calendar)
calendarToCalData:
func (*CalendarData) ToCalendar ¶
func (calData *CalendarData) ToCalendar(cal *Calendar)
calDataToCalendar:
func (*CalendarData) ToLayout ¶
func (calData *CalendarData) ToLayout() (out string)
ToLayout: fill missing char to complies with "2006.01.02.15.04.05", the magical reference format.
func (*CalendarData) ToTimeAsUTC ¶
func (calData *CalendarData) ToTimeAsUTC() (outTime time.Time)
ToTimeAsUTC: convert given time to native UTC (based on local time zone), entered time H,M,S will be considered as UTC (useful for files time comparaison that always calculated using UTC).