Hot answers tagged

70

There are literally half a dozen of toolkits that could be considered “native” on some system. Some of these have rather unique concepts or capabilities, and replicating them in a cross-platform toolkit is tedious. The look & feel of an application is not only determined by a “skin”, but also on the layout and how it behaves. Some considerations: In a ...


56

Isn't it only a matter of designing buttons that look like 'native' buttons? Well - sort of, for buttons. But this might be harder than you imagine. These days the graphics used to represent GUI components aren't as simple as random bitmaps that are stretched (since these don't scale very well at all) - they're often vector based graphics with a lot of ...


36

The thing to remember about GUI code is that it is event-driven, and event-driven code is always going to have the appearance of a mass of randomly organized event handlers. Where it gets really messy is when you try to shoehorn non-event-driven code into the class. Sure, it has the appearance of providing support for the event handlers and you can keep your ...


28

I am generalizing over a couple of GUI libraries but on a very high level the most important concept that you need to understand is that a GUI is event driven. In a console application your user input usually happens at certain points that you defined. You prompt your user, you wait for his input, you calculate something based on that input. One of the ...


26

It sounds to me like you've got a requirement to fix something, but every time you propose a solution (and there are plenty of good ideas in your list) it gets shot down. This is the point where you need to push back. You don't need a vague idea that "this is wrong; fix it." What you need is a spec. Ask the people who want it fixed exactly what they do ...


25

This is easy, if they leave everything blank you prompt that this will print everything, however, the DEFAULT selection in that prompt MUST be to cancel. If they enter values, print whatever they asked for. This way, they won't accidentally blaze through the form and print everything. They'll blaze through and print nothing. They would need to pause, and ...


25

Why? Because they are solving a problem that doesn't exist. The only advantages over a downloaded IDE that I can think of is they occupy less disk space. However, as the price of disk space has dropped to $1/10 Gb, I don't see that as an issue. For those who regularly write code, the disadvantages of Web-based IDEs are that they are slower and less capable ...


25

I don't think it's at all crazy. It all depends on who your target audience is. If you write an app and expect an average user to use it, you are probably better off with a GUI. If your app is a for developers, especially those that are used to CLI. Or if your app is targeting a sys admin who sits at his workstation and SSH's into 30+ other machines on a ...


23

I think many of the problems you are experiencing can be traced back to a simple cause. Most developers do not treat GUI code like 'real' code. I have no evidence or statistics here, just my gut feeling. Maybe they think it is 'just presentation' and not important. 'There is no business logic there', they say, 'why unit test it'? They laugh when you ...


23

There are plenty of web based IDEs. Some of them place an emphasis on collaborative coding. I think that whatever makes you think there aren't a lot of "good" web-based IDE's is probably the subjective definition of what "good" actually means. What features are missing etc... http://codiad.com/ http://www.eclipse.org/orion/ http://shiftedit.net/ https://...


22

There are several methodologies that have evolved over the years to deal with these issues you've mentioned, which are, I agree, the two main issues that UI frameworks have had to address in recent years. Coming from a WPF background, these are approached as follows: Declarative design, rather than imperative When you describe painstakingly writing code to ...


19

Why use a class? Because it makes the job easier, assuming you know how to do object oriented programming, and assuming you're writing a non-trivial GUI. Using objects allows you to easily divide your code into modular units that are self contained, and modularizing your code is generally considered to be a best practice. GUI programming readily lends ...


15

In my company, there are a few people specialized in this job. They are designers. And they know HTML. They can be a bridge between the designers and the front-end engineers; which they usually are. This way, we just have to integrate their HTML. This is a hard job. There's a reason sites like "PSD to HTML in 24h" work well. The solution in our company is ...


14

It seems like your main question is how GUIs and CLIs can exist together at the same time, such as the Windows command console (cmd.exe). It's actually not as complicated as you might think. First, remember that even a GUI needs to be able to render text, so you can read filenames, labels on controls, or work with text inside of programs. It does this by ...


13

Yes, it does go deeper. Building a button which looks like a Windows or OS X button is easy, when you are building only this button. But the button must "behave" like the original ones, which might not be easy: maybe there is more space in one version available, but not in the other, maybe the color is more fitting for your design in the Windows version, ...


12

Like you say. In general, Hungarian notation is a bad practice. I like to keep my names as close to the domain as possible, but sometimes what you are trying to say is that this is the textbox and this is the label. See Kramii's answer to another question for his very reasonable take on why he still uses Hungarian in certain situations. As with all code, ...


12

It is not bad practice to use GUI designer to design your forms, GUI. Esp in Visual Studio. They are there for this purpose and are extensively used. In web development, it is a different story. It is a bad practice to use GUI designer (for example Microsoft Front Page now superseded by WebMatrix). The reason They provide a lot of extra code that you do ...


12

If there's one thing I could recommend, it'd definitely be Boost C++ Libraries. In fact, Boost is not a single library. It's a collection of them, and they're high-quality, portable, open source and well praised by people ranging from students to the C++ standards committee. Since Boost does not include GUI or anything else which is platform-dependent, ...


11

I could give you some rough guidelines as to how to create the equivalent GUI for a CLI app, design-wise. How you would actually make the calls is out of the scope of this answer. switches like -p -v etc are checkboxes mutually exclusive options are a group of radio buttons parameters that are a filename are a textbox with a "choose" button that shows a ...


10

AWT is older than Swing and supports only a limited set of components. Otherwise you have to write your own such as tables/data grids for example (typically, you will have to write your own video player, good luck !). Swing is more "modern" as Sun engineers learned from their AWT mistakes and made something better, albeit more complex. Both Swing and AWT are ...


10

I'll try to give an answer for a more generic question: how to avoid a user making a mistake which leads to disaster or something which cannot be canceled or undone (like wasting paper by printing several pages the user didn't expect to be printed). As said in the original question: The users are in a high-pressure, time-critical environment. Each ...


10

In my experience, a well designed GUI front end, like TortoiseHG doesn't in itself cause problems, what does cause problems however are user misunderstandings and inattentiveness. I use thg as an example because my exposure to TortoiseSVN and TortoiseGit is limited. With a GUI tool, it is very easy for an inexperienced user not to notice that the tool is ...


10

Can't see why not, but you could just run Chrome in "windowless" mode instead, or IE in "hta" mode (we wrote a desktop app using web tech, deploying it as a hta on Windows a decade ago). Today I'd do something without IE/IIS and use websockets for a more interactive experience. There are components that allow webkit embedded in C# apps: see this post from ...


10

There's a number of ways to control UI complexity. If you have lots of forms, you can choose a design pattern that manages transitions: Application Controller for example, or closer to the metal: State. You can compose groups of controls into single controls. In winforms, you use User Controls. If the complexity is coming from the quantity of code in your ...


9

You could use an application to draw mockups instead of writing code. Like Balsamiq Mockups or equivalent. Using Mockups feels like drawing, but because it’s digital, you can tweak and rearrange easily. Teams can come up with a design and iterate over it in real-time in the course of a meeting.


9

One way to avoid refreshing too often would be to use a dirty_flag + a Timer; you set the Timer interval to something like 200ms or whatever value you consider optimal. When en event that requires a refresh happens, you just set the dirty_flag to true, and reinitialize the Timer(that way you make sure that Timer.Tick will be raised at "x" milliseconds after ...


9

There are different tools and different patterns. Tools ADO.NET ADO.NET is much more than DataSet and DataTable. I would not use those classes in any project but instead use the IDataReader to populate pocos as I describe here: http://blog.gauffin.org/2013/01/ado-net-the-right-way/ Data mappers The next step is to use a data mapper. What they do is to ...


9

It's not hard to make a button that looks like an OSX button, or a Windows button, or that of any other toolkit. But the UI guidelines for most environments are not as simple as the basics of "this is what a button looks like." There are many subtler differences, from the spacing between UI elements to the order in which certain well-known actions should ...


9

Greedy Algorithm When a slider moves up (down), all others need to move down (up). Each one has some space it can move (for down - their position, for up: 100-position). So when one slider moves, take the other sliders, sort them by the space they can move, and simply iterate through them. On each iteration, move the slider in the needed direction by (...


Only top voted, non community-wiki answers of a minimum length are eligible