ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I already know how to printf a "hello world" program to the console. My next question is: How do I make this "hello world" a graphical program instead that has the min/max/close buttons at the upper right corner regardless of which GUI environment the Linux distro is using?
I remember XMMS and Auducity can do this. Somehow they tell X11 to omit the window decorations, and they draw their own close button instead. You might search on how to disable window decorations. I prefer to use the defaults for consistency with the user's desktop environment.
I guess I should rephrase the question. My main goal is to create a window/form application that draws boxes/lines/texts/images and has a textbox for user input. I come from a Visual Studio background with knowledge of C# only. My knowledge of another programming language (and Linux) is very limited... (I just took a look at gtkmm and that stuff looks way too complicated for a newbie like me.)
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Just to clarify. There is no single way of producing "a window" under Linux because there are multiple desktop environments. However, using one of the two that BenCollver should mean that anyone interested in your application could install and run it. Perhaps read a little more about Linux desktop environments and window managers.
Oh, I understand it is possible still to write pure X11 applications but I'm not sure how easy or desirable that is.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by eatup
So help me understand another thing. I currently have a charting application written in .NET Framework. The problem is, it renders slow as heck in Windows 7 and 8, but lightning fast in XP.
So, can I reasonably assume drawing a bar chart + line chart combo with more than 1,000 data points that fills the entire screen will be "instantaneous" under Linux? (I would hate to embark on an application with 3000+ lines of code just to find out it performs no better in Linux than Windows 7 or 8.)
Without knowing exactly what you are doing nobody could say. However, Linux is not a panacea and while you could make it a lot faster under Linux if you know your stuff you could do the same under Windows.
Well, either you have to learn another language or you can install mono, which lets you program in C# under Linux. There's a program right here in C# to display a window: http://www.mono-project.com/Mono_Basics
P.S.
Yes, I know mono is evil M$ software, but if all you know is C#, it'll have to do.
Unless you want to program specifically for the Gnome desktop environment I would not recommend to use Vala, since it is aimed at Gnome development.
Mono will be a viable way if you want to stay in the C# world, but it only has a not developed anymore implementation of Windows Forms 2.0 and there are no plans to implement the Windows Presentation Foundation.
Your best bet might be to use one of the GUI toolkits (like GTK or FLTk) or an application framework, like Qt. Many new projects tend to use Qt (and many older are switching), since platform independent programming is relatively easy with it and it has bindings to many program languages, for example PyQt and PySide for Python or QtSharp for C# (and other languages compatible with Mono/.Net).
A C# programmer might appreciate the C# syntax in Vala. Vala should be able to make programs that only require GTK and GObject, neither of which are tied to the Gnome desktop environment. http://www.linuxfromscratch.org/blfs...eral/vala.html
There are printed books about PyQt and I have read opinions that it is pleasant to use.
^ True. Reason why I'm even considering vala is b/c .NET performance sucks in Win7/8. Evil M$ needs to optimize their run time... So, no C# in Linux for me, tyvm!
My next question, if it so I happens I can't figure out how to install Vala in Linux, would it be feasible to develop Vala in Windows and compile the resultant C code in Linux, or must I install some other package for this to work?
Unless you want to program specifically for the Gnome desktop environment I would not recommend to use Vala, since it is aimed at Gnome development.
Mono will be a viable way if you want to stay in the C# world, but it only has a not developed anymore implementation of Windows Forms 2.0 and there are no plans to implement the Windows Presentation Foundation.
Your best bet might be to use one of the GUI toolkits (like GTK or FLTk) or an application framework, like Qt. Many new projects tend to use Qt (and many older are switching), since platform independent programming is relatively easy with it and it has bindings to many program languages, for example PyQt and PySide for Python or QtSharp for C# (and other languages compatible with Mono/.Net).
I agree to what you're saying, but all I need is a simple window with a drawing area and a textbox. Anyways, is there something else better than vala for Linux newbiews that does not rely solely on Gnome?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.