Ampix0
Posts: 94
Joined: Sat Oct 22, 2011 3:03 am

Re: Linux-y question

Sat Feb 25, 2012 4:35 pm

Alright I have a few software questions. I don't know C which I assume I would need to know, but maybe someone can help me out with this.

What I will want on at least one of my Rpi's is an arcade emulatore device.

So what I want is when I power on the device, a small menu you scroll up and down with a list of programs (emulators) and when selected to just execute the emulator.

How difficult is that really? Im sure it would be fairly simple in C. however I am a C# coder.

wrosecrans
Posts: 2
Joined: Sat Feb 25, 2012 6:09 pm

Re: Linux-y question

Sat Feb 25, 2012 6:24 pm

There is no need to do this sort of project in C.  Personally, I recommend every programmer learn a bit of C.  (It's a much smaller, simpler language than C-Sharp, so it's actually a lot easier than you might think!)

That said, I write GUI code for Linux most days at my day job, and the main language I work in is Python.  Many people find Python a very convenient language for writing GUI stuff like you describe.

You will want to learn a bit about the esoterica of what X runs when it starts.  It's actually pretty straightforward to boot to a single app.  There are various ways of doing it, depending on whether you want somebody to have to log on first, or have some way to get to a "normal" desktop for management.  But, once you decide which config file you need to add your application to, it doesn't matter what language that application is written in.  C, Python, bf, per, C++.  X just knows it is running "some program."  There are bindings for popular (and less popular) GUI API's for most languages you would care to write in.

That said, C-Sharp isn't especially well supported on anything but Windows, so I woud suggest not trying to do it in that.  There is some Linux support, but everybody I know who has used, has found the complexities and limitations to be a bit maddening.  (I've never actually sued C-Sharp in anger, so I can't speak about it first-hand.)  It is a language invented by Microsoft to run on their own platforms, so it isn't very surprising that it would be most at-home on Windows.

I would suggest looking up PyQt/PySide.  Writing Python code which uses the Qt UI framework is easy, and very interactive.  (You can build UI code "live" on the python command line interface, which isn't possible in C.  This makes it very easy to figure out what you want to do.  You can set properties on widgets in a window while it is open, and play with it while you tweak it.)  The new "declarative" UI stuff with QML is designed for things like pretty cell phone UIs, so it should be easy to make something that works as a themed game loading menu that doesn't look like one of my boring business apps. 

Ampix0
Posts: 94
Joined: Sat Oct 22, 2011 3:03 am

Re: Linux-y question

Sun Feb 26, 2012 5:01 am

Unfortunately I should have mentioned I write C#.net not regular C#.

Id love to take in a new language but as a college student I dont have much time since I need to still learn java. I think if anything Id like to learn C. So I could do.. anything with an Rpi. in the future I hope.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Linux-y question

Sun Feb 26, 2012 9:05 am

C#.net is regular C#.

You could write the arcade program in Java.

rwgast
Posts: 31
Joined: Sat Feb 18, 2012 10:26 pm
Contact: Website

Re: Linux-y question

Sun Feb 26, 2012 10:35 am

You could acually get really simple with this no real programming involved just be creative! Here were my first two thoughts

#1 if pi is going to boot into xwin then have a browser automatically start, im not sure if chrome is on arm but if so start it in full screen web app mode and link to the files via some web design interface. Even without chrome this will 100% work, i just know chrome can make it look more like its a kiosk or something.

#2 if starting in a command prompt just write a simple menu in bash script. I guess this is coding per say but if you know c# youll figure this out in minutes

wrosecrans
Posts: 2
Joined: Sat Feb 25, 2012 6:09 pm

Re: Linux-y question

Sun Feb 26, 2012 6:50 pm

Ampix0 said:


Unfortunately I should have mentioned I write C#.net not regular C#.

Id love to take in a new language but as a college student I dont have much time since I need to still learn java. I think if anything Id like to learn C. So I could do.. anything with an Rpi. in the future I hope.



Seriously, check out some PyQt.  Like perl and bash, python is one of those languages hat everybody has to deal with at some point so you may as well glance at it.  It's also far less arcane than a lot of the other options out there, and it only take a few minutes of playing to see if you like it.  (At least on Linux.  If you only have Windows, python won't be installed 'out of the box,' so it might take an extra few minutes to get installed.)  Here is an introductory tutorial you can take a look at and see if it strikes your fancy:

http://zetcode.com/tutorials/pyqt4/

I certainly won't discourage you from learning C, but it isn't very widely used for writing flashy GUI type things.  For this specific project, it certainly wouldn't be my first choice.  (Though I have known people to do crazy things in raw C/Xlib, and certainly raw C/Win32.  It's always inconvenient, though.)

bitplane
Posts: 25
Joined: Sun Jan 08, 2012 6:20 am
Contact: Website

Re: Linux-y question

Sun Feb 26, 2012 7:48 pm

If C# is what you already know and you're trying to achieve something rather than learn for the fun of it then it would make sense to start with that.

So have a play with MonoDevelop and evaluate Mono's RAM usage.

Ampix0
Posts: 94
Joined: Sat Oct 22, 2011 3:03 am

Re: Linux-y question

Sun Feb 26, 2012 9:39 pm

Wow monodevelop sounds amazing!

This actually works with .net libraries? Which.. don't exist in linux?

For instance.. I mean any GUI element such as.. A textbox. Does this convert the source to something linux can use? or how is this accomplished.

Return to “General discussion”