How to Add a Toolbar Component to OHIF Viewer Version 2.0
Hello,
I need to create a custom toolbar component. The documentation at https://docs.ohif.org/advanced/extensions.html#modules has broken links to the examples.
Also, the CINE component appears to be rendered in ToolbarModule.js. However if I change text={'CINE'} to text={'CINE2'} and restart the viewer, the text does not change. Is ToolbarModule.js currently being used?
Thank you, Marc
Hello,
I am also trying to add a tool to the OHIF Viewer 2.0. I managed to find how to add the button in the toolBar (go to getDefaultToolbarButtons.js in src/util and add it according to the pattern) but yet I don't know where to implements the command. Don't hesitate to tell me how you are going so far and if you know more now.
Mathis
Mathis,
You can add a toolbar button in getDefaultToolbarButtons but I believe that connects to the cornerstone code, so you'd have to edit that code to add functionality to your button. That seems overly complicated just to add a button. So OHIF added ToolbarModule.js in /src but that doesn't seem to be complete yet.
I'm currently working on the code that will run when the user clicks on the button, so I haven't got back to this.
Marc
On Fri, Jun 21, 2019 at 8:10 AM Mathis Guilhin [email protected] wrote:
Hello,
I am also trying to add a tool to the OHIF Viewer 2.0. I managed to find how to add the button in the toolBar (go to getDefaultToolbarButtons.js in src/util and add it according to the pattern) but yet I don't know where to implements the command. Don't hesitate to tell me how you are going so far and if you know more now.
Mathis
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OHIF/Viewers/issues/547?email_source=notifications&email_token=AGWQ3UVSWIQISLIO73AVMK3P3TAMNA5CNFSM4HXJEWVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYIJJJY#issuecomment-504403111, or mute the thread https://github.com/notifications/unsubscribe-auth/AGWQ3UXGUYCPJXAFLSCDF6TP3TAMNANCNFSM4HXJEWVA .
-- Marc McLean
@mtm12 I've just changed things a bit. You can see my response here: https://github.com/OHIF/Viewers/issues/577
I'm reviewing PRs and writing docs today. Hopefully that's a good enough reference in the interim. Come monday, you should see updated Extension docs. Again, things are decently unstable and will be for at least the next month or so as we iterate over the best approach here.