Cycling74 / min-devkit

Tools, documentation, and reference implementation of a Max Package built using the Min-API.
MIT License
158 stars 31 forks source link

Did all the UI stuff just disappear? #112

Closed CheeseTurtle closed 5 years ago

CheeseTurtle commented 6 years ago

Hi, I successfully created a non-UI version of my MSP object, and after reading the guide to UI objects with Min, I figured making a UI version of it would be fairly straightforward. (I read the Max API/SDK UI stuff, too, just so I would know where Min was "coming from" with its wrappers.)

However, _c74_min_operatorui.h was curiously missing from the min-api/include folder and I had to manually add it myself. Further, the target class of which an instance is created in the min.textslider.cpp file (in the MIN_FUNCTION for the paint message), which was also missing from my fork of the the min-devkit repo --in fact, I only found it by searching old commits --was nowhere to be found, anywhere. I decided that using c74::max::t_rect instead would suffice, since the attributes accessed seem to be the same as those present in t_rect, and I felt comfortable with the change.

Unfortunately, I then hit a serious roadblock: The drawing functions rect<> and text are not defined (or really mentioned at all) in any files that I have been able to locate. This is a serious problem and not one that I am able to rectify, having only just taught myself C++ recently (for the purpose of creating this object, which is the first C++ project I have ever done). I think I might could try to patch up an outdated version of the file (as I did [perhaps badly] with the attempted but error-generating implicit cast from max::t_symbol to max::t_fourcc) but creating these functions from scratch is well beyond my present abilities.

I feel like I've come such a long way and I'm not too keen on giving up. Is this going to be implemented/fixed in the future, or should I start re-coding my object using the max-devkit?

Thanks, Karissa

P.S.: There should be a disclaimer in your documentation! I chose the min-devkit over the max-devkit because I figured higher-level would be easier than lower-level, but not being able to create a UI object would have definitely been a deal-breaker.

P.P.S.: I noticed that the min_textslider example defines itself with public ui_operator, without specifying a default size (or even including any angle brackets at all), even though the documentation says you have to specify a default size (width and height) --implying that it should be ``public ui_operator<000,000>```(where "000" is not the real width/height but a placeholder for a different number). Is it possible, then, to omit a default size and just determine how big the object is in the initialization function and in the mouse message functions?

tap commented 6 years ago

Hi Karissa!

Not sure what revision you are working with... Super-cool to hear of your success with the MSP object.

The UI object support is currently happening on a branch called tap/ui. It isn't fully complete yet (which is why it is on a branch) and it likely won't be completed until sometime after Max 8 is released. If you are interested in experimenting with that branch I can provide you with a couple of additional (somewhat messy) examples too.

Cheers, Tim

CheeseTurtle commented 6 years ago

Thank you so much for your prompt response!

(In case you didn't respond, I figured out how to make a non-UI version of it in C using the Max SDK, but for some reason I have yet to debug, the JGraphics part just isn't rendering. There's probably just some kind of setup function I'm forgetting to call, but oh well.)

However, I would be very interested in experimenting further with the min-sdk! How complete is the UI object support in your branch? I'm trying to make an object called radioselect~ that is a cross between the radiogroup object and the select~ object, with possibly some text label support built-in, so I don't think I need to draw anything too fancy.

tap commented 5 years ago

Sorry for the slow response -- all of our attention was on Max 8 for the last number of weeks. Max 8 is released now though, so I can turn my attention back here...

Drawing and filling circles and rectangles is all in place on the tap/ui branch so an object like that should certainly be feasible!

tap commented 5 years ago

This work has now been merged to master!