Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/vizicist/palette
Browse files Browse the repository at this point in the history
  • Loading branch information
vizicist committed Dec 18, 2023
2 parents 67397fa + bb5f153 commit 0bad99f
Show file tree
Hide file tree
Showing 190 changed files with 14,268 additions and 6,918 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
data/recordings/*
data/saved/archive/vizdesk*
cmd/fyne_demo
data/logs
data/logs
default.bidule.previous
Expand Down
36 changes: 28 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@
"version": "0.2.0",
"configurations": [


{
"name": "palette stop",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/palette/palette.go",
"args": ["stop"]
},
{
"name": "PK2GO - simple.k",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/palette_pk2go/pk2go.go",
"args": ["../../kitlib/simple.k"]
},
{
"name": "PK2GO - arpeggio.k",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/pk2go/pk2go.go",
"args": ["../../kitlib/arpeggio.k"]
},
{
"name": "GUI - palette_gui.py",
"type": "python",
Expand All @@ -32,20 +52,20 @@
"program": "${env:PALETTE_SOURCE}/cmd/palette_monitor/palette_monitor.go",
"args": []
},
{
"name": "MONITOR Engine=false - palette_monitor.go",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/palette_monitor/palette_monitor.go",
"args": ["-engine=false"]
},
{
"name": "palette_chat",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/palette_chat/palette_chat.go",
"args": []
},
{
"name": "palette nats test",
"type": "go",
"request": "launch",
"program": "${env:PALETTE_SOURCE}/cmd/palette/palette.go",
"args": ["nats","{\"api\":\"global.status\"}"]
},
{
"name": "palette logs archive",
"type": "go",
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.81
7.87
Binary file removed binaries/nats/nats-pub.exe
Binary file not shown.
Binary file removed binaries/nats/nats-server.exe
Binary file not shown.
Binary file removed binaries/nats/nats-sub.exe
Binary file not shown.
Binary file removed binaries/nats/nats-top.exe
Binary file not shown.
Binary file added binaries/nats/nats.exe
Binary file not shown.
7 changes: 1 addition & 6 deletions build/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ go build palette_chat.go >> %buildcmdsout% 2>&1
move palette_chat.exe %bin%\palette_chat.exe > nul
popd

rem echo ================ Compiling palette_splash
rem pushd %PALETTE_SOURCE%\cmd\palette_splash
rem go build palette_splash.go >> %buildcmdsout% 2>&1
rem move palette_splash.exe %bin%\palette_splash.exe > nul
rem popd

rem print any error messages from compiling cmds
type %buildcmdsout%

Expand Down Expand Up @@ -107,6 +101,7 @@ rem popd

echo ================ Copying misc binaries
copy %PALETTE_SOURCE%\binaries\nircmdc.exe %bin% >nul
copy %PALETTE_SOURCE%\binaries\nats\nats.exe %bin% >nul

rem echo ================ Copying keykit things
rem copy %PALETTE_SOURCE%\keykit\bin\key.exe %ship%\keykit\bin >nul
Expand Down
2 changes: 1 addition & 1 deletion build/windows/palette_win_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Source: "ship\ffgl\*"; DestDir: "{app}\ffgl"; Flags: ignoreversion recursesubdir
Source: "ship\data\*"; DestDir: "{commoncf64}\{#MyAppName}\data"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
; Source: "ship\data_surge\*"; DestDir: "{commoncf64}\{#MyAppName}\data_surge"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
; Source: "ship\data_moldover\*"; DestDir: "{commoncf64}\{#MyAppName}\data_moldover"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
Source: "logs_readme.txt"; DestDir: "{commoncf64}\{#MyAppName}\logs"; DestName: "readme.txt"; Flags: ignoreversion
Source: "logs_readme.txt"; DestDir: "{commoncf64}\{#MyAppName}\data\logs"; DestName: "readme.txt"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; This specifies the Visual C++ Windows Runtime Redistributable to install, it's put in {app}\bin to help debug things.
Expand Down
144 changes: 144 additions & 0 deletions cmd/button/button.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
package main

import (
"math"
"strings"

"github.com/visualfc/atk/tk"
)

type Window struct {
*tk.Window
}

func NewWindow() *Window {
w := tk.RootWindow()
//button
btn1 := tk.NewButton(w, "Button1")
btn2 := tk.NewButton(w, "Button2")
btn3 := tk.NewButton(w, "Button3")
btnInfo := tk.NewLabel(w, "Info")
fninfo := func(btn *tk.Button) {
btnInfo.SetText(btn.Text())
}
btn1.OnCommand(func() { fninfo(btn1) })
btn2.OnCommand(func() {
fninfo(btn2)
})
btn3.OnCommand(func() { fninfo(btn3) })

hbox1 := tk.NewHPackLayout(w)
hbox1.AddWidgets(btn1, btn2, btn3, tk.NewLayoutSpacer(w, 0, true), btnInfo)
//check
chk1 := tk.NewCheckButton(w, "Check1")
chk2 := tk.NewCheckButton(w, "Check2")
chk3 := tk.NewCheckButton(w, "Check3")
chkInfo := tk.NewLabel(w, "Info")
fnchk := func() {
var info []string
if chk1.IsChecked() {
info = append(info, chk1.Text())
}
if chk2.IsChecked() {
info = append(info, chk2.Text())
}
if chk3.IsChecked() {
info = append(info, chk3.Text())
}
chkInfo.SetText(strings.Join(info, "&"))
}
chk1.OnCommand(fnchk)
chk2.OnCommand(fnchk)
chk3.OnCommand(fnchk)
hbox2 := tk.NewHPackLayout(w)
hbox2.AddWidgets(chk1, chk2, chk3, tk.NewLayoutSpacer(w, 0, true), chkInfo)

//radio
radio1 := tk.NewRadioButton(w, "Radio1")
radio2 := tk.NewRadioButton(w, "Radio2")
radio3 := tk.NewRadioButton(w, "Radio3")

radioInfo := tk.NewLabel(w, "Info")
group1 := tk.NewRadioGroup()
group1.OnRadioChanged(func() {
radioInfo.SetText(group1.CheckedRadio().Text())
})
group1.AddRadios(radio1, radio2, radio3)
hbox3 := tk.NewHPackLayout(w)
hbox3.AddWidgetList(group1.WidgetList())
hbox3.AddWidgets(tk.NewLayoutSpacer(w, 0, true), radioInfo)
radio2.Invoke()

//menubutton & menu
mbtn := tk.NewMenuButton(w, "MenuButton")
mbtnDir := mbtn.Direction()
mgroup := tk.NewActionGroup()
var dirs []tk.Direction = []tk.Direction{tk.DirectionBelow, tk.DirectionAbove, tk.DirectionLeft, tk.DirectionRight}
for _, v := range dirs {
act := mgroup.AddNewRadioAction("Direction" + strings.Title(v.String()))
act.SetData(v)
if mbtnDir == v {
act.SetChecked(true)
mbtn.SetText(act.Label())
}
}
mmenu := tk.NewMenu(w)
mmenu.AddActions(mgroup.Actions())
mbtn.SetMenu(mmenu)
mgroup.OnCommand(func() {
act := mgroup.CheckedAction()
if act != nil {
mbtn.SetDirection(act.Data().(tk.Direction))
mbtn.SetText(act.Label())
}
})

hbox4 := tk.NewHPackLayout(w)
hbox4.AddWidget(mbtn)

hbox5 := tk.NewHPackLayout(w)
spin := tk.NewSpinBox(w)
spin.SetRange(0, 100)
spin.SetValue(0)
spin.Entry().SetWidth(5)

scale := tk.NewScale(w, tk.Horizontal)
scale.SetRange(0, 100)
scale.SetValue(0)

spin.OnCommand(func() {
scale.SetValue(spin.Value())
})
spin.Entry().OnEditReturn(func() {
scale.SetValue(spin.Value())
})
scale.OnCommand(func() {
value := math.Round(scale.Value())
spin.SetValue(value)
})

hbox5.AddWidget(spin)
hbox5.AddWidget(scale, tk.PackAttrFillX(), tk.PackAttrExpand(true))

vbox := tk.NewVPackLayout(w)
vbox.AddWidget(hbox1)
vbox.AddWidget(hbox2)
vbox.AddWidget(hbox3)
vbox.AddWidget(hbox4)
vbox.AddWidget(tk.NewSeparator(w, tk.Horizontal), tk.PackAttrFillX(), tk.PackAttrExpand(true))
vbox.AddWidget(hbox5)

vbox.SetBorderWidth(10)

return &Window{w}
}

func main() {
tk.MainLoop(func() {
w := NewWindow()
w.SetTitle("ATK Button Demo")
w.Center(nil)
w.ResizeN(400, 300)
w.ShowNormal()
})
}
Loading

0 comments on commit 0bad99f

Please sign in to comment.