SDL 1.3 and Menus

Since there are windows that don’t have menus, and there are windows that
have multiple menus, this is clearly a composition issue, both in UI design
and software design.

As far as I know, OSX is the only OS that requires every app to have a menu.
But therein lies the distinction. Every app has a menu, not every window.
Look at XCode. You bring up XCode, you bring up multiple windows, but the
top menu doesn’t change. Further using that example, there are several
windows that have no standard menu at all.

I don’t see why you’d want to force the users of the API deal with extra
parameters for cases they’re not going to use 100%, or even 50% of the time.On Fri, Dec 19, 2008 at 5:00 PM, Brian Barnes wrote:

Bob Pendleton wrote:

Start with a false premise end with a false conclusion :slight_smile:

Actually, no. The problem is that you are thinking code wise, not
user-wise, and that is the biggest (IMHO) problem with open source software.
You’re also having a problem with variations on the 90/10 rules, getting
caught in minutia and missing the big picture.

Menus are most definitely not an attribute of a window. That is an
assumption that was made by just about everyone 20+ years ago and it
turned out to be wrong. Menus are their own thing. They are windows in
their own right. When you start looking at any kind of interesting GUI
you start finding that menus need to be able to be aggregated, moved
around, they may need to be ripped (by the user) from one window to
another, they may need to float of to the side or be docked in their
own containing windows. You might not even know what windows will be
available in a window until you have queried the objects withing the
window. Hey, that big blue dragon has his own menu, but only when it
is on the screen and the contents of the menu change depending on how
long it has been since he ate a virgin…

Menus an attribute of windows? No…

Open up any of your programs – 99% of the users will have their menus
either docked always at the top (OS X) or always at the top of a window
(unless it’s the new fangled toolbar menus, which are just fancy menus.) To
them – and to most users – menus are parts of a window.

It’s you guys baby, I’d be more than happy to submit OS X and Windows code
when I got around to trying it, and you guys decisions. But I think pulling
out an example that, if even a real program, would be less than 1% of the
usage of this doesn’t really make a case :slight_smile:

If you need something so special, then it’s a edge case and you’ll have to
handle it yourself. If you want the old regular menus, then that would be
something the core could provide, though I doubt I’m getting this :slight_smile:

[>] Brian


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2008/12/19 Brian Barnes :

Bob Pendleton wrote:

Start with a false premise end with a false conclusion :slight_smile:

Actually, no. The problem is that you are thinking code wise, not
user-wise, and that is the biggest (IMHO) problem with open source software.
You’re also having a problem with variations on the 90/10 rules, getting
caught in minutia and missing the big picture.

I strongly disagree. It is missing the big picture that brings up
exactly the kind of misconception that you have.

Menus are most definitely not an attribute of a window. That is an
assumption that was made by just about everyone 20+ years ago and it
turned out to be wrong. Menus are their own thing. They are windows in
their own right. When you start looking at any kind of interesting GUI
you start finding that menus need to be able to be aggregated, moved
around, they may need to be ripped (by the user) from one window to
another, they may need to float of to the side or be docked in their
own containing windows. You might not even know what windows will be
available in a window until you have queried the objects withing the
window. Hey, that big blue dragon has his own menu, but only when it
is on the screen and the contents of the menu change depending on how
long it has been since he ate a virgin…

Menus an attribute of windows? No…

Open up any of your programs – 99% of the users will have their menus
either docked always at the top (OS X) or always at the top of a window
(unless it’s the new fangled toolbar menus, which are just fancy menus.) To
them – and to most users – menus are parts of a window.

This is because of the corruption of the word window. Originally, a
’window’ was simply a self-contained drawing region. Both X11 and
Windows draw everything into a window; a menu is a window in and of
itself. You may argue that this is an implementation detail, but
step-back: think about this: “How do I define a system that can allow
arbitrary composition with any number of base elements?”

If you think about it long enough, you will end up with what is, in
X11 and Windows parlance, a window.

It’s you guys baby, I’d be more than happy to submit OS X and Windows code
when I got around to trying it, and you guys decisions. But I think pulling
out an example that, if even a real program, would be less than 1% of the
usage of this doesn’t really make a case :slight_smile:

If you need something so special, then it’s a edge case and you’ll have to
handle it yourself. If you want the old regular menus, then that would be
something the core could provide, though I doubt I’m getting this :slight_smile:

What if I wan’t to have my own menu system with funky graphics or
chunky text or pictures for say, children, or I dunno… a game? Why
should I be forced to conform to a general-case structure that simply
doesn’t suit my needs?

As far as I can tell, OS X doesn’t allow arbitrary window composition.
That REALLY sucks; it massively reduces flexibility to define your own
solutions. This is the price you pay for a Macs ‘ease of use’. It
would seem that the problem you have is actually that you’re
developing on a Mac; if you were developing under X11 or even, heaven
forbid, Windows, you would know that you can create an application
window, then create an SDL surface as a child to that window.

Finally, it is interesting that you make the assertion that ‘most’
people will want a menu for their SDL apps. Call me old fashioned, but
’most’ SDL apps are games, and most games seem to run full-screen
and/or have simple menus (i.e. a simple up/down, start, options, quit
type menu). Therefore, ‘most’ SDL apps don’t want/need OS-style menus.

I would argue that, actually, yours is the corner case!

Merry Christmas!

Eddy

P.S. Try ParaGUI.

Edward Cullen wrote:

> Bob Pendleton wrote:
>
>   Start with a false premise end with a false conclusion :-)
>
> Actually, no.  The problem is that you are thinking code wise, not
> user-wise, and that is the biggest (IMHO) problem with open source software.
>  You're also having a problem with variations on the 90/10 rules, getting
> caught in minutia and missing the big picture.
I strongly disagree. It is *missing* the big picture that brings up
exactly the kind of misconception that you have.

I see I’m not going to win any argument here. All I’m asking for is a conduit into how OSes handle menus now, which is usually attached to windows or the top of the screen. This is what 99% of people think of when they think of menus. You guys can come up with as many big picture ideas as you want, and they might all be valid, but they aren’t exactly what users of OS X and Windows expect.

>
>   Menus are most definitely *not* an attribute of a window. That is an
>   assumption that was made by just about everyone 20+ years ago and it
>   turned out to be wrong. Menus are their own thing. They are windows in
>   their own right. When you start looking at any kind of interesting GUI
>   you start finding that menus need to be able to be aggregated, moved
>   around, they may need to be ripped (by the user) from one window to
>   another, they may need to float of to the side or be docked in their
>   own containing windows. You might not even know what windows will be
>   available in a window until you have queried the objects withing the
>   window. Hey, that big blue dragon has his *own* menu, but only when it
>   is on the screen and the contents of the menu change depending on how
>   long it has been since he ate a virgin....
>
>   Menus an attribute of windows? No......
>
> Open up any of your programs -- 99% of the users will have their menus
> either docked always at the top (OS X) or always at the top of a window
> (unless it's the new fangled toolbar menus, which are just fancy menus.)  To
> them -- and to most users -- menus are parts of a window.
This is because of the corruption of the word window. Originally, a
'window' was simply a self-contained drawing region. Both X11 and
Windows draw everything into a window; a menu *is* a window in and of
itself. You may argue that this is an implementation detail, but
step-back: think about this: "How do I define a system that can allow
arbitrary composition with any number of base elements?"

If you think about it long enough, you will end up with what is, in
X11 and Windows parlance, a window.

CWnd::SetMenu. Windows obviously understands the concept of menus being part of a window. It might be implemented (as you noted) as a separate window, but it’s what the end user sees that matters.

The problem is to make this concept work, you have to IGNORE OS X, which is what you do below by saying it lacks flexibility. Maybe it does, but if SDL is supposed to be cross platform, then this is something you can’t ignore.

> It's you guys baby, I'd be more than happy to submit OS X and Windows code
> when I got around to trying it, and you guys decisions.  But I think pulling
> out an example that, if even a real program, would be less than 1% of the
> usage of this doesn't really make a case :)
>
> If you need something so special, then it's a edge case and you'll have to
> handle it yourself.  If you want the old regular menus, then that would be
> something the core could provide, though I doubt I'm getting this :)
What if I wan't to have my own menu system with funky graphics or
chunky text or pictures for say, children, or I dunno... a game? Why
should I be forced to conform to a general-case structure that simply
doesn't suit my needs?

As far as I can tell, OS X doesn't allow arbitrary window composition.
That REALLY sucks; it massively reduces flexibility to define your own
solutions. This is the price you pay for a Macs 'ease of use'. It
would seem that the problem you have is actually that you're
developing on a Mac; if you were developing under X11 or even, heaven
forbid, Windows, you would know that you can create an application
window, then create an SDL surface as a child to that window.

Finally, it is interesting that you make the assertion that 'most'
people will want a menu for their SDL apps. Call me old fashioned, but
'most' SDL apps are games, and most games seem to run full-screen
and/or have simple menus (i.e. a simple up/down, start, options, quit
type menu). Therefore, 'most' SDL apps don't want/need OS-style menus.

I would argue that, actually, *yours* is the corner case!

Again, you can’t ignore OSes that you think “don’t do it right.” SDL would, be definition, have to handle that kind of stuff. And, I’m not asking for regular menus in game, that would be silly. If you have funky menus, then do it like you do it now. What I’m thinking is for these uses:

  • simple cross-platform utility apps for games

  • if you game goes into windowed mode for some reason, use the menus to launch debug information or additional things

    P.S. Try ParaGUI.

I have my own GUI routines, that’s not what I’m looking for. I’m not
looking for a IN GAME GUI, not at all. I’m looking for an easy way to
make cross-platform utility apps for my application, with minimal GUI.
i.e., very non-game type apps. I think you guys are assuming I’m trying
to make in-game GUIs easy, that’s not the case. Having a menu in a SDL
app is probably something that would only happen at certain times, in
certain apps.

Again, I’m not going to win this one :slight_smile:

[>] Brian

I see I’m not going to win any argument here. All I’m asking for is a
conduit into how OSes handle menus now, which is usually attached to windows
or the top of the screen. This is what 99% of people think of when they
think of menus. You guys can come up with as many big picture ideas as you
want, and they might all be valid, but they aren’t exactly what users of OS
X and Windows expect.

I think you’re again demonstrating what it is that you’re not getting.
Menus are not part of the “operating system.” Commercial OS vendors
have sold you into bondage and you’ve bought it, and bought into the
idea that there is this magical atomic indivisible structure called an
"operating system" that does everything from talk to peripheral
devices to paint your menus for you.

You are right about one thing: most users expect menus to be part and
parcel with software development kit.

But they’re wrong.

You’re probably thinking that I’m just repeating what has already been
said up to this point, but I don’t think you understand that SDL is a
library for developers it is not a commercial product being marketed
at end users without technical knowledge (although it often has to
face ideological challenges as though it were – and as in this case
– because let’s face it, SDL is primarily used by game developers,
oftentimes the lowest eschelon of computer programmer there is,
perhaps with a few exceptions of really awesome people.)

I believe SDL provides everything you need to get started writing your
own satellite library to provide whatever cross-platform menu support
you want. SDL 1.2 has APIs for getting at underlying platform-specific
window handles (good for setting up menus on Microsoft Windows
platforms.) I believe adding menus to an SDL application deployed for
Mac OS X is also a fairly straightforward procedure that can be as
simple as double-clicking some “.nib” file (probably stands for
NextStep Interface Builder) and then adding some Objective-C code to
your project to handle the messages generated by menu activation.

I have my own GUI routines, that’s not what I’m looking for. I’m not
looking for a IN GAME GUI, not at all. I’m looking for an easy way to make
cross-platform utility apps for my application, with minimal GUI. i.e.,
very non-game type apps. I think you guys are assuming I’m trying to make
in-game GUIs easy, that’s not the case. Having a menu in a SDL app is
probably something that would only happen at certain times, in certain apps.

When I was much younger I loved a game called Descent 2 and a level
editor called Descent 2 Mission Builder. But there were limitations in
D2MB and with my limited programming experience I wanted more power. I
soon learned that there were other “open source” (whatever that means)
editors for Descent 2-related files, and when I first saw one I was
horrified. The menus and buttons were all alien and didn’t have the
nice and familiar look and feel of other Windows applications.

I hope that abrupt anecdote has helped to convince you that I
understand how you feel about the menus you want – there is something
good about consistency and familiarity in user interfaces that goes
beyond intuitive interaction. But if you look at the games available
today, you’ll see that the best and/or most profitable game developers
out there have chosen the route I eventually came around to: it’s easy
to find a $5 or $10 game with a native GUI, but games by ID or EA
don’t go that route, and with good reason: it isn’t portable, and it
costs more to maintain.

Granted, all that you want is menus, not a large collection of GUI
widgets. The only advice I can leave you with then, is this:

Again, I’m not going to win this one :slight_smile:

You’ve already won everything you need to get started. You’re just not
going to convince other people that your solution fits so well into
everyone’s application that it deserves a place in SDL. In fact we can
say with confidence that it doesn’t fit well into most developers’
applications. Develop your own library! And please release it to the
rest of us so that we can all point to your library the next time
someone asks for the same thing! (Can you imagine having contributed
more than two emails to this thread if the responses had all been to
use BriansMenuLib?On Mon, Dec 22, 2008 at 9:47 AM, Brian Barnes wrote:


http://codebad.com/

Sorry Brian, I should have read your message more carefully.On Mon, Dec 22, 2008 at 9:47 AM, Brian Barnes wrote:

I have my own GUI routines, that’s not what I’m looking for. I’m not
looking for a IN GAME GUI, not at all. I’m looking for an easy way to make
cross-platform utility apps for my application, with minimal GUI. i.e.,
very non-game type apps. I think you guys are assuming I’m trying to make
in-game GUIs easy, that’s not the case. Having a menu in a SDL app is
probably something that would only happen at certain times, in certain apps.

I recommend learning to use GTK+. It’s very well suited to this sort
of task. If you want OpenGL there are GTK+ widgets which will house an
OpenGL context, and if you want framebuffer access like you get with
the SDL display surface, you can use the underlying GDK API and the
GtkDrawingArea widget. The menus look and feel very intuitive and
familiar and are not bound to your viewport the way a so-called
"in-game GUI" is. The only potential drawback I can think of is that
I’m not sure what the state of Mac OS X support is – although it’s
always worked perfectly on Mac OS X using X11.app!

Also, when you say “utility apps,” it makes me think you’d also like
to breeze through the development process, in which case I recommend
Glade (a GTK+ interface designer application which can generate an XML
description of your GUIs) and PyGTK (Python bindings to the GTK API.)


http://codebad.com/

Donny Viszneki wrote:

You are right about one thing: most users expect menus to be part and
parcel with software development kit.

But they’re wrong.

Honestly, guys :slight_smile: If the reason against this idea is that 99% of what
users expect and 99% of what OS vendors make for the past 20 years is
just wrong and the couple of us on this list are right, then I’m
never, ever, ever going to win this argument :slight_smile:

I feel like I’m swimming against an enormous tide that you guys are
generating when you swim against an enormous tide :slight_smile:

This isn’t a big deal – I’ve created what I needed outside of SDL,
which is probably better for a utility program. Basically a lite
wrapper for making a cross platform win32/OS X simple application;
single windows, all OpenGL drawing, menus, etc. Everything I do is
OpenSource/freeware anyway.

[>] Brian

Honestly, guys :slight_smile: If the reason against this idea is that 99% of what users
expect and 99% of what OS vendors make for the past 20 years is just wrong
and the couple of us on this list are right, then I’m never, ever, ever
going to win this argument :slight_smile:

This shouldn’t be about winning an argument. You have the tools to do
what Sam et al have done: create a library.

I feel like I’m swimming against an enormous tide that you guys are
generating when you swim against an enormous tide :slight_smile:

This isn’t a big deal – I’ve created what I needed outside of SDL, which is
probably better for a utility program. Basically a lite wrapper for making
a cross platform win32/OS X simple application; single windows, all OpenGL
drawing, menus, etc. Everything I do is OpenSource/freeware anyway.

Apparently you’ve already taken the leap. So… where is the link?On Mon, Dec 22, 2008 at 6:51 PM, Brian Barnes wrote:


http://codebad.com/

I recommend learning to use GTK+. It’s very well suited to this sort
of task.

A bit offtopic, but what’s the difference between GTK+ and GTK? Because
from what I’ve heard, GTK is so horrible that even the open source people
don’t like working with it. Case in point, from the Lazarus project dev blog
( http://lazarus-dev.blogspot.com/2008/06/amazing-features-in-0926.html )

Gtk just doesn’t help. Having worked with the Windows API, Qt, fpGUI,
Cocoa and Gtk, I am absolutely sure that Gtk is the worse GUI toolkit I
have ever seen. Yes, even worse then direct Windows API, because at
least the Windows API works!

A small comparison of the development difficulty in each widgetset:
Implementing TTrayIcon under Windows API: 4 hours
Implementing TTrayIcon under Qt: 3 hours
Implementing TTrayIcon under Gtk 2: 2 weeks

When the lead of a major open source project says it’s even worse than
Windows… I’m a bit leery of it.>----- Original Message ----

From: Donny Viszneki <donny.viszneki at gmail.com>
Subject: Re: [SDL] SDL 1.3 and Menus

A bit offtopic, but what’s the difference between GTK+ and GTK?

They’re the same thing.

When the lead of a major open source project says it’s even worse than
Windows… I’m a bit leery of it.

An annoyance with GTK+ is the amount of boilerplate you have to write.
It’s pretty strongly object-oriented (as opposed to the core Windows
API, which is only weakly so), but in C, so you have to write a lot of
stuff that a C++ (or Objective-C, or whatever OO language) compiler
would take care of for you.

They’re coming up with all sorts of wacky things to make up for that,
not that I approve much: http://live.gnome.org/ValaOn Tue, Dec 23, 2008 at 12:32 PM, Mason Wheeler wrote:


http://pphaneuf.livejournal.com/

I learned GTK+ because Qt was based on C++ rather than C. I’ve also
heard that Qt is much easier to use, but I went with GTK+ so that I’d
have experience with the GUI toolkit used by OLPC. FWIW the
"TTrayIcon" example given by the Lazarus developer sounds like an
atypical situation.

Using Glade and PyGTK I would compare development time of most typical
applications to be similar to what you get with Visual Basic, with the
notable advantages that your applications are more portable and you
don’t have to know Visual Basic.

glib is also a great library to have around. The glib "main loop"
event dispatching subsystem is a wonderful provision for a very common
application design requirement.

But take this review with a grain of salt: I’ve never used Qt, but I
have one friend who has used both, and this is what she had to say
about it:

(3:43:53 PM) Me: hey which do you prefer hacking with? gtk or qt?
(3:50:39 PM) Quinn: C++ sucks usually
(3:51:00 PM) Quinn: and QT uses a preprocessor too
(3:51:08 PM) Me: yikes
(3:51:16 PM) Quinn: signal/slot thingy
(3:51:48 PM) Me: is that related to that preprocessor?
(3:51:56 PM) Quinn: that’s what its for
(3:52:28 PM) Me: oh
(3:53:49 PM) Quinn: I prefer gtk in general, but I prefer kde in general
(3:53:52 PM) Quinn: so I’m kinda stuck
(3:54:03 PM) Quinn: that is I prefer to use kde, but I prefer to code in gtkOn Tue, Dec 23, 2008 at 12:32 PM, Mason Wheeler wrote:

I recommend learning to use GTK+. It’s very well suited to this sort
of task.

A bit offtopic, but what’s the difference between GTK+ and GTK? Because
from what I’ve heard, GTK is so horrible that even the open source people
don’t like working with it. Case in point, from the Lazarus project dev blog
( http://lazarus-dev.blogspot.com/2008/06/amazing-features-in-0926.html )


http://codebad.com/

I forgot to add one really important thing: Unless you’re optimizing
your code, or writing new widgets / libraries for distribution, I
would avoid programming GTK+ with C at all costs. It’s a real pain.On Mon, Dec 22, 2008 at 7:39 PM, Donny Viszneki <@Donny_Viszneki> wrote:

On Mon, Dec 22, 2008 at 6:51 PM, Brian Barnes wrote:

Honestly, guys :slight_smile: If the reason against this idea is that 99% of what users
expect and 99% of what OS vendors make for the past 20 years is just wrong
and the couple of us on this list are right, then I’m never, ever, ever
going to win this argument :slight_smile:

This shouldn’t be about winning an argument. You have the tools to do
what Sam et al have done: create a library.

I feel like I’m swimming against an enormous tide that you guys are
generating when you swim against an enormous tide :slight_smile:

This isn’t a big deal – I’ve created what I needed outside of SDL, which is
probably better for a utility program. Basically a lite wrapper for making
a cross platform win32/OS X simple application; single windows, all OpenGL
drawing, menus, etc. Everything I do is OpenSource/freeware anyway.

Apparently you’ve already taken the leap. So… where is the link?


http://codebad.com/


http://codebad.com/

(3:43:53 PM) Me: hey which do you prefer hacking with? gtk or qt?
(3:50:39 PM) Quinn: C++ sucks usually
(3:51:00 PM) Quinn: and QT uses a preprocessor too

I’m normally a fan of C++ over C, but Qt did make a hash of C++. While
most C++ libraries will usually lean over to the side of making it
difficult to screw up, sometimes making it frustrating to get started,
Qt went the opposite way, to great effect (it’s very easy to make a Qt
app, and thus there are a lot of them!), but it can be somewhat screwy
(it’s very easy to a Qt app that leaks memory, say).

For example, they were a bit overzealous in making their QString
behave just like a “const char*”, so they made it automatically
convert to that (so that anywhere that takes a “const char*”, a
QString will do just the same, but without having to manage the memory
and all that fuss!). Sounds good? Except for the bit where they also
added the conversion the other way, so that this code:

const char mystring[] = “this is an example string”;
const char* substring = mystring + 11;

This should get “substring” pointing at “example string”, right? If
you include qstring.h at the top of the file WITHOUT CHANGING YOUR
CODE AT ALL, it will instead point at “this is an example string11”.
Oh, and in recently deallocated memory, too, so it’s not actually
valid to use it.

The standard string class has none of these problems, but in exchange,
you have the incredible pain of having to add “.c_str()” when calling
a function that expects a C string. Oh, the humanity!

Valgrind was invented to debug Qt applications, from what I remember,
which is kind of indicative.

The pre-processor was needed because of older C++ compiler that didn’t
support templates, and they’re kind of forced to keep going with this,
but nowadays, you’d use something like TR1’s “function” with “bind”
(both practically standard), Boost’s Signals, or sigc++.

I’m told that Gtkmm is actually pretty nice, from some friends (it
uses sigc++, so no pre-processor), but I haven’t used it myself.On Tue, Dec 23, 2008 at 3:55 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/