From: Harishankar Date: Tue, 23 Oct 2018 16:17:19 +0000 (+0530) Subject: Initial Commit X-Git-Url: https://harishankar.org/repos/?p=resumebuilder.git;a=commitdiff_plain;h=b820ddf1e8f0f8ef9e3b6c00972c45e128290051 Initial Commit First commit --- b820ddf1e8f0f8ef9e3b6c00972c45e128290051 diff --git a/ResumeBuilder b/ResumeBuilder new file mode 100755 index 0000000..c4c2cbf Binary files /dev/null and b/ResumeBuilder differ diff --git a/resumebuilder.glade b/resumebuilder.glade new file mode 100644 index 0000000..1a6d5b6 --- /dev/null +++ b/resumebuilder.glade @@ -0,0 +1,208 @@ + + + + + + MainWindow + False + center-on-parent + + + + + + True + True + + + True + False + + + 225 + True + True + name + + + 221 + 11 + + + + + True + False + First name + + + 37 + 18 + + + + + True + False + Last name + + + 37 + 57 + + + + + 225 + True + True + name + + + 221 + 50 + + + + + True + False + Sex + + + 37 + 132 + + + + + Male + 59 + 24 + True + True + False + True + True + + + 151 + 131 + + + + + Female + 75 + 24 + True + True + False + True + True + Male + + + 222 + 131 + + + + + Other + 65 + 25 + True + True + False + True + True + Male + + + 303 + 131 + + + + + True + False + Age + + + 37 + 97 + + + + + 50 + True + True + digits + + + 220 + 89 + + + + + Save + 130 + 34 + True + True + True + + + 307 + 168 + + + + + False + + + + + True + False + Basic Details + + + False + + + + + True + False + + + 1 + + + + + True + False + Education + + + 1 + False + + + + + + + + + + + + diff --git a/resumebuilder.go b/resumebuilder.go new file mode 100644 index 0000000..cc78373 --- /dev/null +++ b/resumebuilder.go @@ -0,0 +1,97 @@ +package main + +import ( + "fmt" + "os" + + "github.com/gotk3/gotk3/gtk" +) + +type Applicant struct { + FirstName string + LastName string + Age int + Sex Sex + Education []Education +} + +type Education struct { + SchoolName string + YearOfPassing int + PassPercentage float32 +} + +type Sex int + +const ( + Male Sex = 1 + Female = 2 + Other = 3 +) + +/* func SaveToJson(a *Applicant) { + b, err := json.Marshal(a) + + if err != nil { + fmt.Println(err.Error()) + os.Exit(2) + } + err = ioutil.WriteFile("test.json", b, 0644) + if err != nil { + fmt.Println(err.Error()) + os.Exit(3) + } +} */ + +func getWindow(ui gtk.Builder) (*gtk.Window, error) { + obj, err := ui.GetObject("MainWindow") + if err != nil { + fmt.Println(err.Error()) + return nil, err + } + wnd, ok := obj.(*gtk.Window) + if !ok { + return nil, err + } + return wnd, nil +} + +func LoadMain() { + gtk.Init(nil) + ui, err := gtk.BuilderNewFromFile("resumebuilder.glade") + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + + wnd, err := getWindow(*ui) + if err != nil { + os.Exit(1) + } + + btnobj, err := ui.GetObject("SaveButton") + if err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + btn, ok := btnobj.(*gtk.Button) + if !ok { + os.Exit(1) + } + btn.Connect("clicked", SaveButtonClicked) + wnd.SetTitle("Resume Builder") + wnd.ShowAll() + + wnd.Connect("destroy", func() { + gtk.MainQuit() + }) + gtk.Main() +} + +func SaveButtonClicked() { + +} + +func main() { + LoadMain() +}