A new GUI for openFrameworks

I corrected the incorrect display of framed rectangles on certain video-cards.

The actual version is now ofxhGui 1.01

You can downlod it here:

Many thanks to kylemcdonald for his clever solution

thank you for that!


Hi bernard!
I was wondering if you would consider moving ofxhgui hosting to github?
Most oF stuff already lives there, so it would probably help with contributions/maintenance/discoverability, and the addon could be indexed and shown in http://ofxaddons.com/ (see http://forum.openframeworks.cc/t/self-discovering,-self-documenting-ofxaddons/7909/0 for details)

Thank you bilderbuchi for reminding me that.
It was may intention since the beginning but I didnt understant how it works and I wanted to put it online quickly.

I will take a deeper look on it soon.

Whoa, this is a great site. Is it stickied anywhere under add ons? If not it should be.

bernard, if you need help with git(hub), I’m happy to assist. It shouldn’t be too difficult. basically, get a github account, open a new repo, put your code in it. Last step depends on if you want to preserve the history in your current repo.
edit: huh, it’s even simpler:

GitHub can directly import SVN projects. All you need is the repository URL. After creating a repo you can pick “Import a Subversion Repository” option:

some more info (you probably don’t even need): http://help.github.com/import-from-subversion/

rodvik: yes, it’s awesome. this is still a work in progress, so it’s nothing “official” yet. As soon as it’s “finished”, there will definitely a sticky thread. :wink:

Thank you bilderbuchi.

I put ofxhGui on github:

Since it’s the first time I used something like that (I don’t know nothing about versioning systems) I don’t know if all I did is correct.

Does github preserve all versions or only the last one ?
Is it possible to remove easyly useless files (like .DS_Store) or do I have to make a new commit for this ?

I realized that on the example projects I send, I didn’t remove the object files. Is it wrong?

Did you do the import as I indicated above? “After creating a repo you can pick “Import a Subversion Repository” option:” ? If yes, I would have expected that it would take the whole history, but here you can see that you didn’t keep the history: https://github.com/bernardgeyer/ofxhGui/commits/master

Yes, you can tell git to ignore certain files with a .gitignore file in the repository. It will not remove files which are already in there, though.
Yes, object files shouldn’t be part of the repo.

I have to go now, but I will try to help you with this in the evening, and put you on your way. In the meantime, have you already found https://github.com/openframeworks/openFrameworks/wiki/openFrameworks-git-workflow ? On the bottom, there are some links for git(hub) beginner resources.

hm, I’ve browsed through the repository on google code, and there’s nothing in there. did you keep this on your local disk? If yes, the next question is how badly you want the history? Cause it could be done, there’s commands and scripts out there, but I never completed that before.

I have created a gitignore file which filters many things, but there are some strange things going on I can’t explain. Also, you directory structure/repo organisation is strange, maybe that contributes to the problem.

All the binaries/object files, etc. are already in your repo (and thus needlessly make it large). This is difficult to correct, especially if you have already published the repo.
So, maybe it would make sense to create a new repo with just the source and project files, split out ofxhUtils (as it should be), create a standard repo directory structure according to http://ofxaddons.com/howto, and publish it anew. But I won’t start work on this until you give the OK, I neither want to get you mad or something, nor do unnecessary work.
This would also have the advantage that it makes ofxhGui a drop-in solution for users (and they don’t need to move directories around).
So, what do you think?

I never used Subversion or similar tools (and the persons or organisations for which I worked either) so I have nothing to import.

Maybe the best solution would be to delete the entire repository, take the time to learn how all this work (also by analyzing other addons), and start again from scratch.

OK. I attached a gitignore file which should already ignore most problematic files.

Best approach would be

  1. read the link I provided, and look at ofxaddons for the directory structure
  2. delete your repo on github
  3. make a fresh, empty, repo on github
  4. git clone it down to your local disk (this will automatically set your GH repo as “origin” remote point for easy pushing
  5. put the gitignore file in as the first thing.
  6. make the directory structure, and start dropping in stuff. put ofhutils into a totally separate addon.
  7. commit early, commit often. but pay attention if the gitignore works. don’t commit binary files, and files which are autogenerated on compilation (.o etc) - gitignore should already be good for this, but watch it nonetheless.
  8. fix the problems the changed dir structure brought. :slight_smile:
  9. push to GH.

if you need help, we’re here…
happy coding


ok, thank you

well, I think I am ready now.

I made 2 addons (for ofxhGui and ofxhUtils) and put them here https://github.com/bernardgeyer in separate repos.

I hope everything is correct now.

There is just one thing that I’m not clear with:

I think it is usefull to send also the project files, specially because it is such a pain to add
files manually in CodeBlocks.

I know, we have addons.make, but I think it is usefull to have the source files in the project.
(by the way, does addons.make works in the same way in windows than in linux ?)

So, I have different files and different number of files for the 3 platforms :

in mac os x:
and the bundle folder ofxhGuiExample1.xcodeproj
that contains

in linux:

in windows:

how should I add these files to my directories ?

hi! I just skimmed over it, looks good, great work! I will play around with it this weekend hopefully.

regarding the project files:
in linux, addons.make and config.make are sufficient (as far as I know), the rest will be generated with the createprojects.py script in /openframeworks/scripts/linux.
I don’t think this works on windows, yet. maybe someone else can comment on this (and on the best way to accomodate all the project files in addons). arturo?

Attention regarding codeblocks projects: (if not autogenerated) you should always have a .workspace file, too, and always open this - it contains information about the openframeworks CB project file, so you will get automatic re-compilation of oF if necessary, and code completion, etc. It’s probably best to take one from an existing addonsExample, and modify it where necessary. Don’t have too much experience with that, though.

macOS: sorry, no idea.

Thanks bilderbuchi.

Just not shure if this discussion belongs to this thread. It may interest other addons makers too.

Just a question about ofxhGui. I’ve been trying different UI addons (including ofxhGui) but so far is the only one that I can’t find a way to draw pictures/videos as a part of the layout. There’s not a widget for images.

Any tips about this?

I didn’t see pictures or videos as a part of the interface, but rather the data, that is drawn in the draw() function (as you can see in my example app)

If you want to draw something inside of the interface, you can create a hPanel object (with or wihout a border) and store its adress or its coordinates somewhere in testApp.h

You can also find the coordinates with int getX(void); int getY(void); int getWidth(void); and int getHeight(void);

Than you draw your picture or video in the draw() routine using these coordinates.

Warning: it works only if the panel has no visible background (also true for eventual parent panels)
you can use setVisibleBackground(false); to be shure.
I just tested it, it works.

With many different pictures it could be usefull to implement pictures into the GUI; also if one want to skin some buttons with pictures. I can do it, but this will slow down the drawing of the GUI

The following message was adressing a similar problem :

In the future I think to draw only changing objects (f.e. with an FBO) but this will make more complicated the synchronisation between the GUI and variables

For which reason you are interested to have pictures/videos to be part of the interface ?

Thanks for the heads up. I also thought that if it wasn’t natively supported it would be work arounded just like you said :wink:

The reason I need such functionality from a GUI addon is because I’m doing a multimedia course that uses openFrameworks as the “learning” platform and the final project is to develop an interactive media/video library with it. So those kind of functions would help a lot, to have thumbnais, click on them, lay them out, etc…

I can try to implement it, I’m just actually very busy with other projects (musical)

If I understand well, you are not yet shure which interface you will use ?

When will be your course and where ?