Write Your Own GUI!

This is a new forum that can be used to discuss anything that's not directly related to JPatch.

Write Your Own GUI!

Postby John VanSickle » Sun Apr 10, 2011 2:08 am

After hearing that there were issues with running my modeler under the WINE emulator, and for reasons of portability, I have been implementing some of the GUI elements inside the application, instead of making use of OS calls. And since I wouldn't even be on this board unless I preferred to roll my own when doing things like this, I am writing a GUI library. It has turned out to be surprisingly easy.

This is all in OpenGL, and drawing the GUI is rather simple; after drawing the 3D elements (the model and all that) I hand OpenGL the transformation matrices that work best for 2D drawing, turn off depth testing, and slap the GUI elements onto the screen.

As far as the controls go, I have a status bar that clings to the bottom edge of the window and a tool bar that clings to the left edge, and both of them re-size as needed when I re-size the window. The toolbar can move its buttons around to make them fit, and can add columns to make room for them as need be. I need to finish re-doing the icon imagery, and fix anything that broke with this change, and then I think I'll let the new app be seen in public.
John VanSickle
 
Posts: 189
Joined: Sat Feb 16, 2008 2:17 am

Re: Write Your Own GUI!

Postby sascha » Sun Apr 10, 2011 11:43 am

I agree, as far as simple on screen controls are concerned (it's best to let OpenGL do all the drawing, that's usually faster than the OS doing some sophisticated compositing) - something like mode-switcher buttons or infos that are rendered semi-transparently over the 3D scene, etc.

But more sophisticated UI elements like trees, lists, textfields, scroll-views, etc... I don't know. Blender comes to mind, with lots of nonstandard UI elements that alienate users (it's much better now with the recent 2.5.x builds, but it still feels odd. I guess developing the Blender GUI alone has become a fulltime job though).
And if you try to do it right, you'll spend more time working on the custom widgets than on your modeler :?
This was quite frustrating when working on JPatch - recognizing that Java Swing doesn't provide much but very basic UI functionality, and having to write custom GUI elements you'd expect the framework to provide.

If you're looking for cross-platform toolkits, check out wxWidgets and Qt. I haven't used any of them, but David is a wxWidgets expert :)

Just my two cents.

And since I wouldn't even be on this board unless I preferred to roll my own when doing things like this

Heh :-)
I haven't got much time these days, but I try to keep to forum free of spam. If you'd like to have admin rights or add a Lion Snake subforum, just let me know.
I've also found a way to efficiently block spammers on the f-sim.com forum (by requiring a moderator approval for the first post, but then let the users post without moderation) which works pretty well - I'm going to implement the same configuration here on the jpatch forum.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Write Your Own GUI!

Postby dcuny » Thu Apr 14, 2011 9:23 pm

I've just handed over wxBasic to another person to administer - I just don't have time to support it any more! I haven't been following wxWidgets for years, but it's one of the nicer cross-platform libraries out there. But it's really, really big if you're just looking for something simple like a basic GUI.

Some applications lend themselves to custom widgets, and I think 3D applications fall into that category. For example, Wings3D did that pretty well.

While I think Blender is unnecessarily complex (which created a niche for JPatch), I don't think the Blender UI itself is the core problem. Rather, there wasn't a sufficient focus on an "ease of use" workflow.
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Re: Write Your Own GUI!

Postby John VanSickle » Wed Apr 27, 2011 10:49 pm

Re-did the icon imagery, and I fixed a small bug that crept in, but now I've decided to add scroll bars. This appears to be the next fairly easy control to add. I am finding that there is some sense to the way Windows does some of these things...
John VanSickle
 
Posts: 189
Joined: Sat Feb 16, 2008 2:17 am

Re: Write Your Own GUI!

Postby pndragon » Sat Apr 30, 2011 8:53 pm

I'm still trying to work out the patch modeler in python 3. I'll confess that I haven't been trying as hard as I might but I've been distracted (my wife was diagnosed with breast cancer in February and spent most of April in the hospital). I may have to just let it go and that would be great loss I believe.
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Re: Write Your Own GUI!

Postby dcuny » Fri May 06, 2011 12:05 am

I'm sorry to hear about your wife. :(

We can only do what we can, and learn to live with that. If I had a couple more lifetimes, I'd have finished up my renderers, and a half dozen other projects as well. As it is, I've had a ton of fun, and am pretty happy with that. I just wish my animation had made it into the last IRTC contest. :?

Good luck to both of you!
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Re: Write Your Own GUI!

Postby sascha » Sun Jun 19, 2011 9:23 am

Sorry to hear about your wife. Wishing you well!

We can only do what we can, and learn to live with that. If I had a couple more lifetimes, I'd have finished up my renderers, and a half dozen other projects as well. As it is, I've had a ton of fun, and am pretty happy with that.

That's what counts. And you'll only know in retrospect how "the dots connect" - I'm not happy about that I had to stop working on JPatch, but on the other hand, I've learned so much about programming, math, 3D graphics and OpenGL. I couldn't do what I'm doing now without that experience.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria


Return to Off topic

Who is online

Users browsing this forum: No registered users and 1 guest

cron