Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there no CSS-like GUI creator [closed]

Okay, so this will probably be closed or whatever, I don't care. I have to say this because it just frustrates me like hell.

Once upon a time, I came from a html/css/php background into the vast deeps of application development. I wandered around the valleys of Java and explored the mysteries of C#. I gasped at the beauty of Ruby, fell over the stubborn simplicity of Bash and from time to time came back to visit my old friends HTML, CSS and PHP.

It was until I had the quest to create a Desktop application in Java that I was shocked about the pain and suffering I had to go through in order to make the application more or less user-friendly in terms of look and feel.

I was trapped in a nightmare of LayoutManagers, Docking parameters and whatever foul creatures lied beyond the gates of java.swing and companions.

At this point, I felt an idea breeding in me. As it was said by Cobb; What is the most resilient parasite? Bacteria? A virus? An intestinal worm? An idea. Resilient... highly contagious. Once an idea has taken hold of the brain it's almost impossible to eradicate. An idea that is fully formed - fully understood - that sticks; right in there somewhere. - Y'know, that kinda idea.

I was wondering, why couldn't it be just as easy as my buddy CSS made it. Layouting as such, using margins, borders, floatings, whatever.

Modern web-applications are completely designed in pure, simple, easy CSS. Am I insane for wanting the same for my desktop-applications? The gap between the both closes more and more as I write this. There are web-pages out there that are far more complex than anything most hobby-programmers will write in their entire life.

I just can't understand why GUI creating has to be such a fuss. Probably it's just because I come from a different background and am used to CSS-like styling, so only I feel this way, but still;

Hasn't anybody ever thought of this? Would it be so hard to create a CSS-parser to style GUI? With the exact same methods as in web-development? Classes, IDs, selectors etc. What's the big difficulty in creating this?

Does anybody even feel the same way I do?

Or (what would be quite emberassing) is there such a tool and I was just too stupid to find it?

like image 351
F.P Avatar asked Sep 09 '10 08:09

F.P


People also ask

Is CSS used for GUI?

Mozilla's XML-based language XUL uses CSS as a tool for gui layout.

Can you use HTML for a GUI?

GUI of your Java app can be built by HTML/CSS/JavaScript developers. It significantly reduces the cost of Java project development. The following simple application demonstrates how to create a Java Swing dialog which GUI represents a web page built with the HTML/CSS/JavaScript technologies.

How do I fix CSS errors?

Replace broken CSS files with those ones that return 200 HTTP status codes or remove them. What else should be considered to fix the problem: Try to clear your browser's cache. If the page returns 5xx errors, the problem may be on the server: it's not handling the traffic because it's too slow or misconfigured.


2 Answers

Microsoft NET's WPF (Windows Presentation Foundation) is a GUI-creation solution kind of similar to HTML + CSS.

IMO, it is much more versatile than HTML, but still easy to use (and to create readable GUI code).

Defining layout is as easy as this:

<DockPanel>     <Label Content="Dock Panel Layout Demo"      FontSize="15" FontWeight="Bold" Background="LightBlue"     Foreground="Blue" DockPanel.Dock="Top"/>      <Label Content="Footer" FontSize="15" FontWeight="Bold"             Background="LightGray"            DockPanel.Dock="Bottom" />      <Label Content="Left Pane" FontSize="15" FontWeight="Bold"            Width="125" Background="Firebrick"            DockPanel.Dock="Left"/>     <Label Content="Content Pane" FontSize="15" FontWeight="Bold"            Width="255"            Background="Beige"/>      <Label Content="Right Pane" FontSize="15" FontWeight="Bold"            Width="125" Background="Khaki"            DockPanel.Dock="Right"/> </DockPanel> 

And styles:

<Window.Resources>     <Style x:Key="myStyle" TargetType="Button">        <Setter Property="Background" Value="Orange" />        <Setter Property="FontStyle" Value="Italic" />        <Setter Property="Padding" Value="8,4" />        <Setter Property="Margin" Value="4" />     </Style> </Window.Resources> 
like image 142
Matěj Zábský Avatar answered Sep 20 '22 14:09

Matěj Zábský


Mozilla's XML-based language XUL uses CSS as a tool for gui layout. They have an article on "Skinnable XUL and CSS". :)

like image 23
Kyle Avatar answered Sep 19 '22 14:09

Kyle