gui

Qt - Drawing a Rect/Frame out of a bigger Pixmap image.

Hi there, I've been banging my head about this seemingly easy task and I could really use some help. I have a wide Image loaded in the gui (using the designer..) and I want to be able to draw only a portion of it, a rectangle. I need to be able to change this rectangle position over the large image, in order to draw a different part of ...

how to stop JPopupMenu show() from visually un-selecting the list item clicked on

Right now when a user right clicks on a selected JList item in my program the resulting JPopupMenu clears the selection (at least visually) until the popup menu is closed. This isn't consistent with the native look and feel of any platform I know of. The item should stay visually selected or have a selected-color border around it. But I ...

[GTK+] Change progress bar with circular wait image

Hi, Is it possible to skin the GTK+ progress bar widget such that it shows a custom image (an AJAX style animated gif maybe)? If so how and if not, is there any other option/control which can achieve this effect? ...

How to use colors in Motif

I'm new to GUI programming in C and Linux, and I'm having a hard time with it. It seems like a fairly simple/straightforward thing, but I can't find any answers googling. I want to add a background color to a widget. XmNbackground seems to be what I want to use, but I don't understand what I set it to, like a simple color blue, how do I ...

Developing for bumptop

Does anybody have experience interacting programmatically with bumptop desktop ? Something like adding widgets on the walls, or moving/resizing the icons ? is there an API for that ? ...

How set a translucid background color on jtextfield ?

I have a snippet that change the color of a JTextField : textField.setBackground(new Color(155, 0, 0, 155)); When the color is changing, the component has a strange behaviour: the cursor twinkling becomes not regular, as so the color opacity that seems to change on ongoing repaint events. If the color is created without specifying al...

BlackBerry - How to create sub menu?

i want to create sub menu for a BB application when i click on menu item it shows Option 1 Option 2 Option 3 When i click on option 3 it should display 1 2 3 as sub menu items.. using j2me + eclipse ...

Are there any problems with having a group of win forms in one thread and another group in another thread?

I have an application that has two distinct groups of win forms and I want each group to operate in separate threads. Are there any problems with this approach as long as I BeginInvoke/Invoke when operations happen across the different threads? This question stems from the fact that I've always been used to thinking in terms of a 'gui ...

Calculate scrollbar height according to amount of hidden contents

I'm creating a graphical scrollbar so I need to calculate the scrollbar height manually. You know how in most applications the scrollbar height changes based on how much there is to scroll? What is the formula for calculating the scrollbar height based on the amount of hidden contents? Is it logarithimic or exponential or just plainly b...

Method sleep until event fired

Hi, I have a poker framework for which I am trying to develop a "player" for. Basically I am implementing an object that implements a Player interface defined by the framework. I am trying to put a GUI on top of this player, the way that game play works is that the Dealer invokes the act() method on my player and expects a return type o...

Way to quickly show/hide WinForms GUI C#

I'm creating an app that is threaded. I started GUI (Announce : Form) as separate thread. That window will be very minimalistic with one input box and maybe a button. On another thread there will be Tcp Client running and when it gets info from TcpServer it should pass what it gets into that inputbox and show the gui (and topmost window...

C# create an array of controls

Is it possible to create an array of controls? Is there a way to get the index of a control if more than one of the controls in the array share the same event handler? ...

Java: How to immediately send changes in a text field to a file?

Is it hard to do the following with the Java? First I need to generate a window with a text field (no buttons, nothing, just a text field). Than, when a user types a symbol in the text filed, program immediately stores information about this in a file (which symbol was typed and when). That's it. ...

JSplitPane giving wrong resize cursor with GTK LAF?

Running the official JSplitPane demo http://java.sun.com/docs/books/tutorial/uiswing/components/splitpane.html on my Ubuntu system gives a resize cursor like --> over the divider. The behavior of native split panes gives <--> resize cursors. Does this qualify as a bug that should be reported to Sun (eh, Oracle)? Is there a workaround? ...

How to put a text area (JTextArea) into a window (JFrame)?

I have a working code which creates a window with a text area. The code is here. I try to figure out how this code works. A lot of things are clear: The main-method creates an instance of the TextAreaDeom class (which is subclass of the JFrame). In other words, the main-method creates a window. In the main-method we set some "parameter...

Best python UI package for simple graph simulations (TSP simulation, etc...)

I've never done any UI programming in python before. What is the best (read most intuitive, easy to use, functional) UI package for python for doing simulations? I'll be doing a simulation of TSP right now. So I'll have a graph (nodes and edges) where the edges are rapidly changing, along with some selection boxes to choose differen...

JSlider for doubles

Hi, I am making a GUI (using swing) for a poker framework and need some sort of slider to allow players to select a bet size. However the Swing JSlider only works with int values whereas i need something that can support doubles for 1 decimal point. Are there any libraries I can use, or tricks with the JSlider? Thanks ...

How can I draw nodes and edges in PyQT?

In PyQT, how can I plot small "Nodes" at given points and connect them with edges? All of the PyQT tutorials I find are "plot a button! plot a checkbox!" Huge thanks in advance ...

Alternative to spinlock

Hi, I am using the following spinlock approach: while(!hasPerformedAction()){ //wait for the user to perform the action //can add timer here too } setHasPerformedAction(false); return getActionPerfomed(); this basically waits for a user to perform an action and then returns it. Currently something requests an answer from th...

In PyQt, how can signals and slots be used to connect a dropdownlist to a function?

In PyQt, there's a concept of signals and slots to connect objects to one another's functions, but I can't seem to find them referenced to functions not associated with other objects. For example, I want a dropdown list to have algorithm A or algorithm B run. How does PyQt accomplish this functionality? ...