rezaali / ofxUI

[DEPRECATED] UI Addon for openFrameworks
http://www.syedrezaali.com/#/ofxui-project-showcase/
518 stars 202 forks source link

example-CustomPlacement label missing ? #222

Open eloimaduell opened 9 years ago

eloimaduell commented 9 years ago

Hi ...

I'm facing problems when adding widgets with addWidget() and addWidgetEastOf() ... I chequed the example-CustomPlacement and I realized that this widget doesn't appear on screen ? or i don't see it ?

gui->addWidgetDown(new ofxUILabel("CUSTOM WIDGET LAYOUT", OFX_UI_FONT_LARGE), OFX_UI_ALIGN_RIGHT);

Is this an issue with this example or something i don't understand ? Shouldn't I be able to see the "CUSTOM WIDGET LAYOUT" label ?

More generally, when i do :

gui = new ofxUICanvas(0,0,400,ofGetHeight()-80); gui->addLabel("RENDERER"); gui->addWidgetWestOf(new ofxUILabelButton("LOAD WEST",true),"RENDERER"); gui->addSpacer();

I can't see the "LOAD WEST" label anywhere ... just the RENDERER one ? Am i missing something ?

Thnks for such a great OF UI ... e*

wasawi commented 9 years ago

Make sure the Canvas is big enough to contain the text you want to draw. Otherwise, if the text is too long it just won't draw. Many people (including me) has had this problem. I think we should allow the text to draw out of bounds.. otherwise it just looks like a bug.

eloimaduell commented 9 years ago

Hi Jordi !

Well indeed i also found out that elements that lie out of the canvas are not drawn ... but in the case of the ofxUI example ... why "CUSTOM WIDGET LAYOUT" label doesn't appear on screen ? It's ouf of the canvas ? It was added though a addWidgetDown ... I can't see it because it's out of bounds ?

Thanks !

wasawi commented 9 years ago

Yes.. its the same issue. But you are right, in this case is not so obvious. I strongly suggest this issue to be fixed. In my branch I acutally let ofxUI to crash the app if something is not drawn, that way i can see why is not drawing.

In that case the problem is that the font is too tall for the default canvas. You can try to set the font to small:

gui->addWidgetDown(new ofxUILabel("CUSTOM WIDGET LAYOUT", OFX_UI_FONT_SMALL), OFX_UI_ALIGN_RIGHT);

or to set the canvas with some height

gui = new ofxUICanvas(1000,500);

then you will see the text.

Is that correct for you too?

eloimaduell commented 9 years ago

hi Jordi !

Yes ... you're right .. here it is ... changing just size shows me the "label" ;) In fact that is a simple example that it's useless for me at the end ... but now i see that there's no bug, just a matter of sizing and make the label get drawn ....

I'll dive better in some of my other problems related with "widgets" not appearing and try to make a simple example of them ...

thanks !