newtonscript - How do I set custom buttons when using protoApp instead of newtApplication? -
i'm developing newton os app in newtonscript , protoapp
proto fits application type better newtapplication
proto (i.e. newtapp). protoapp
provides title & status bar close box, how insert custom buttons in status bar (since shows clock)?
i found this thread on newtontalk, paul guyot says:
you don't need use protoapp. can use protofloater instead. can add nicer newtonos 2.x-like status bar replace ugly clock/battery picker of protoapp , put close box on bar. trick steal bar newtapp framework, i.e. use newtstatusbarnoclose. did several projects, it's documented in doc (the fact can use newtstatusbar[noclose] instead of protostatusbar) , can take advantage of buttons handling code (to align them automatically on left , on right).
it turns out suggestion of using newtstatusbar
instead of protostatus
is documented in newton programmer's guide (2.0) on page 7-19:
note
new status bar protos newtstatusbarnoclose , newtstatusbar, preferred way add status bar applications. these protos, described in “newtapp applications” (page 4-1), simplify adding buttons , automate hiding close box when application moved background.
and, paul's suggestion of using protofloater
instead of protoapp
dead-on, although, ended using protodragger
. had manually add prototitle
& protostatusbar
:
mainview := { _proto: protodragger, viewflags: vapplication + vvisible + vclickable, appsymbol: kappsymbol, viewjustify: vjparentfullh + vjparentfullv, viewbounds: {left: 16, top: 16, right: -16, bottom: -16}, stepchildren: [ { _proto: prototitle, title: kapptitle }, { _proto: newtstatusbar, menuleftbuttons: [], menurightbuttons: [] }, ], };
Comments
Post a Comment