Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

example-CustomPlacement label missing ? #222

Open
eloimaduell opened this issue Sep 26, 2014 · 4 comments
Open

example-CustomPlacement label missing ? #222

eloimaduell opened this issue Sep 26, 2014 · 4 comments

Comments

@eloimaduell
Copy link

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
Copy link

wasawi commented Sep 29, 2014

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
Copy link
Author

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
Copy link

wasawi commented Sep 29, 2014

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
Copy link
Author

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 !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants