Multiwindow with ofxUI
Hi Reza! I'm trying to create an app with the UI in a separate window from from main application. I've been playing around ofxFenster, but have been running into issues. Do you have a working example of this?
Hey Tim,
So I haven't played with this for a while. I'll try to hack something together tomorrow and send upload it onto github.
if I don't get back to you by friday, text me :)
Thanks man! Really appreciate that. Great work on all those awesome examples, btw.
i gotten it to work with ofxFenster, but I had to manually call the draw method for the ofxUICanvas.
So after some investigation, it looks like ofxFenster @underdoeg is going through some major changes due to OF 0.8.0 change to GLFW. So I made an example with of0074 and sent that to @timstutts, but I am going to wait until ofxFenster is updated to officially add an example using ofxFenster. There are some issues with it as I see it:
- Mouse callback from one window affects other windows (this might be an ofAddListener issue @arturoc)
- Draw does not work at all, so you have to do something along the lines of gui->draw();
I am also trying to make ofxUI work with both OF 7 and OF 8, so changes and fixes will be coming next week.
Cheers, Reza
hi. I have not looked into the details of this but I guess ofxUI uses ofAddListener bindings to mouse and draw events? Problem is that those don't work well with a multiwindow structure. (how can you distinguish what window triggered the single, global draw event) So to get it work you need something like "disable all automatic events and then pass them into a root object" I've never used ofxUI so I don't know how it works internally but if you can point me to the relevant code, I can have a look at it.
And yes. ofxFenster is going thru some major changes so you might considering only supporting the new version with ofxUI.
cheers
thanks for that example, @rezaali! huge help. also, @underdoeg, your add-on saved the day. look forward to the next version.
@underdoeg Yes it does use ofAddListener for all the events. I totally agree with you, those don't work well with the multiwindow, one way to fix this is to subclass "ofxUIAppCBGlue" this is the class that handles connecting ofxUI with the events from the app. In theory you could get this working with a multiwindow structure without much trouble. I'll try to give it a go when I get a second, I'd love to start using it with ofxFenster
@timstutts any updates on this? Did you ever try ofxUI with the updated version of ofxFenster? Closing for now until this is relevant again.
FYI I'm using ofx fenster on OSX with multiple windows using 0.74 and an older version of ofx fenster and 0.8 with the current ofx fenster.
I´m having the same issues with UI and ofxAppGLFWWindowMulti. Trying to figure out a solution