Programming :: Xlib C Program Doesnt Work Every Time
Jul 24, 2010
I tried to draw two lines with xlib.h in C. If I start this compiled program it show me in most cases a window with two lines as it should be.
But sometimes the two lines are not drawn.If I insert XFlush() before the second XSync() it worked better but not every time.Why?How can I solve the problem?How works the X-Server buffer in detail?
Code:
View 1 Replies
ADVERTISEMENT
Nov 23, 2010
I want to connect my OpenSuse 11.3 Distribution with the Internet via WLAN. But i can't open the KNetworkManager. It doesnt respond to my clicks. If I click on the KNetworkManager "Button" it doesen't react.
Result : I can't modify my WLAN-Connection.
View 8 Replies
View Related
Feb 3, 2010
I was doing an exercise on Learning Perl, 3rd edition. (exercise chapter 10 btw) The problem asks to create a program that generates a random number and asks the user to guess. It should tell the user if the guess is lower or higher and exit if the user types either exit or quit. My code is the following:
Code:
#! /usr/bin/perl
$correct = int(1+rand 100);
[code]....
View 2 Replies
View Related
Jun 12, 2011
I'm trying to build a program called Obpager, but I'm getting an error saying I don't have xlib.h. From what I understand, that file is included in libx11-dev, which I have installed. Any idea?
Code:
dagoss@MAGIC-PORT:~/Downloads/obpager-1.8$ make
Compiling src/main.cc
In file included from src/main.cc:33:0:
[code]....
View 2 Replies
View Related
Jun 24, 2011
I need to write a program for time. like i have 2 tasks both minutes and hours.
like this
1st task=5 hours and 30 minutes
2nd task=2hours and 45 minutes
Together they will take 8 hours and 15 minutes.
I need to write a program thats called ADDTIMES to do something like this.
This is what i have so far.
H1=int(input("enter the number of hours:")) etc..
View 6 Replies
View Related
May 11, 2011
im trying to calculate how much time does my program run, use very simple script
clock_t end, start;
start= clock();
int i;
printf("initial %d
",(int)start);
[Code]....
but it outputs 0 all the time. cant figure out where could be the problem.
View 2 Replies
View Related
Apr 24, 2011
i have the example code below, i want to calculate the time taken for a sample program to run. but i keep getting undefined reference error.
#include <sys/time.h>
#include <iostream>
int main(int argc, char **argv) {
struct timeval startTime;
struct timeval endTime;
[Code]...
View 9 Replies
View Related
Oct 16, 2010
I am making a program to do a breadth first search.The code which I am posting here just makes a que of the nodes visited in a binary tree in inorder fashion,so this implementation is not yet complete.While developing I got a segmentation fault which I was not able to understand why I am getting so I am posting since the tree of same program (without BFS) is working.
Code:
#include<stdio.h>
#include<stdlib.h>
[code]...
View 4 Replies
View Related
May 9, 2011
I am having trouble with encryption/ decryption program. The program goes out and finds the file I want it to, encrypts it into a continuing series of a single repeated negative number, then generally decrypts(or should i say re-encrypts)it into a widely repeated character, different but same results every time.
[Code]....
View 3 Replies
View Related
May 19, 2011
i am graduate student and my X colleague gave me this Fortran 77 program to run my result files with. She is no longer reachable. I compiled the following program with gfortran, it compiled well but, when i run it, gave me end of file error. My output file (which is the input file for this program (DFILE1) ) has about 78,000 lines of velocities of atoms (Vx, Vy, Vz with 1000 steps.. an example of some of the atom's velocities in the 1st step is given at the end of this program). I will be highly obliged if any one can help me with this.I run this program on opensuse linux 11.3 version /32 bit/i586
error message:
Code:
At line 124 of file v.autocorrelation.f (unit = 10, file = 'DFILE1')
Fortran runtime error: End of file
Code:
PROGRAM TCORR
COMMON / BLOCK1 / STORX, STORY, STORZ
COMMON / BLOCK2 / VX, VY, VZ
COMMON / BLOCK3 / VACF, ANORM
C *******************************************************************
code....
View 6 Replies
View Related
Mar 12, 2009
I am having trouble writing an Xlib application that displays a window. The most frustrating thing is that I've written applications like this before, and never had any problems. For some reason I cannot get this program to work properly. I'm running KDE and when I launch the program, a "button" for the application will appear on the application panel, however, no window will display. It is possible to right click on the panel button and select the Close item which will successfully close the window.
The following is source code that when built will exhibit the behaviour described above code...
View 10 Replies
View Related
Jan 15, 2011
Suppose i have an XID of a window. How can i wrap QPainter to draw on this window? I need something like cairo_xlib_surface_create(), but Qt-based.
View 3 Replies
View Related
Oct 17, 2010
I am working on xlib project to develop text editor without using help from any of toolkit/widgets.I get stuck in scrollbar.I have no idea how they work and developed.It become more difficult as I am using low-level C library - xlib.
View 1 Replies
View Related
Mar 3, 2009
The code below seems to do a right mouse click (firefox 2.0.0.7) IF I pass it 3, but I cant get it to do a left mouse click?
View 4 Replies
View Related
Dec 6, 2008
I am starting to learn Linux graphical programming. Most of codes in my hands were written based on xlib, which is a kind of old graphic lib. I see some developers more interested in openGL. Then what's the difference between xlib and openGL? And which one is more popular used in which industry area?
View 2 Replies
View Related
Aug 3, 2009
I'm trying to get the width of a string in pixels this way:
Display *disp;
int len;
disp = XOpenDisplay(0);
font = XLoadQueryFont(disp, desc );
[code]....
I'm getting negative numbers as the the pixel length, eg -7275
View 3 Replies
View Related
Nov 17, 2010
I'm working on an application which generates random shapes when clicking on a window. I designed the window using Motif. I want to invoke the ButtonPress Event .
View 1 Replies
View Related
Oct 8, 2010
i want to get the state of a particular window by using the _NET_WM_STATE atom. i dont know how to use it with XGetProperty.
View 6 Replies
View Related
Dec 11, 2009
I'm making a game with the xlib library. What I want to do is to know if the character is standing on a trap or something else.
So far I've solved that using the coordinates but when I draw circles or stuff not shaped like a rectangle it gets to hard to make the game exact.
So what I'm asking for is if there is some kind of function in the xlib that tells you which color a pixel has. Because then it'd be much easier.
I've searched but I haven't been able to find anything good. I found XGetPixel() but that appears to work only with images, maybe I can make my window to be an "image"?
View 7 Replies
View Related
Apr 27, 2010
I'm trying to understand how to use colors in Xlib programming. What I think I understand so far is that modern displays use 24 or 32-bit TrueColor. And TrueColor uses three colormaps, one for each primary color, and a single pixel value is composed of three indices.
Now the part i'm confused about is how to get my programs to use a 32-bit TrueColor visual. I thought I could inheret the visual from the root window to get color but it seems no matter what pixel value I use it's either black or white.
I guess my question is, how can I setup my programs so that I can specify a pixel value that is a combination of RGB values to get the color I want?
I come from windows where I simply used RGB(r,g,b) macro to specify colors and never had to worry about depth and colormaps and visuals, so I'm a bit overwhelmed by all of these concepts.
View 1 Replies
View Related
Dec 14, 2008
I want to do some experimentation with GUI programming. What mostly interests me is how the toolkits actually work (what are the drawing mechanisms, how it communicates with X, etc.) and how the window managers work. I know it's quite a lot but I don't plan on developing the next best DE/Toolkit/Window Manager, just to play with API, mostly to learn. It seems that there is a shortage of documentation on this topics, I'm trying to find anything for 2 days now with no result.
View 7 Replies
View Related
Jul 24, 2011
So this picture will explain [URL].. So after i typejj java -jar RSBot-257.jar it should have to come ijj up.It doesent show any errors but doesent start.What to do?
View 1 Replies
View Related
Oct 6, 2010
The error is: error while loading shared libraries: libncurses.so.5: cannot open shared object file: Error 24 This occurs after a good time of running, after I added some file stuff to my code. I can't see why this is happening.
Code: Code:
// Get CPU Temperature
char sensorsRaw[128];
system("sensors >& .sensors");
std::ifstream fileIn;
fileIn.open(".sensors");
[Code]...
View 3 Replies
View Related
Apr 15, 2010
I'm just wondering what the limits for time are. I have a program that always takes exactly 20 ms, so I assume this is the lowest it can measure, but I want to see if there's some sort of documentation of this.
View 3 Replies
View Related
Feb 6, 2010
I am using 8.04 Sometimes, when I start some video or audio file, I cant hear the sound. Even if it is working some time back. Then it starts all of a sudden or mostly I need to do a restart.
View 2 Replies
View Related
Mar 27, 2010
when i go to ccsm and activate any setting it doesnt seem to take affect....
View 1 Replies
View Related
May 16, 2010
i've come to replacement my 80 yr old fathers win98 machine with lucidFirefox 3.6.3 says 'connecting to .....' when accessing a webpage (eg his home igoogle page,bbc.co.uk ) and then times out .It all works with opera and links2 and pings are the usual times and its doing DNS . I've added 4.4.4.4 and 8.8.8.8 to /etc/resolv.conf for good measure FF its configured NOT to use a proxy ( Im fed up looking and checking !) and ive tried the 'detect settings automatically'this is a 'mission critical' step. Going to linux is a big enough change , so getting FF working will be a deal-breaker
View 3 Replies
View Related
Jan 9, 2011
i'm havng issues
Code:
bahie@bahie-laptop:~$ sudo apt-get install screenlets python-rsvg
[sudo] password for bahie:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-rsvg is already the newest version.
[Code]...
View 7 Replies
View Related
Aug 20, 2010
I am installing in Kubuntu (I cant stand ubuntu anymore) But when i try to use dd to install to a USB, I cant because Ubuntu got rid of the root and when i sudo it, It doesnt seem to work!
Here is the message i get:
View 10 Replies
View Related
Jan 6, 2011
I have coriander-2.0.0-1.fc14.i686 installed and it does n t work anymore as it used to with my IIDC compliant ieee1394 camera.
I understood that raw1394 and video1394 modules are now deprecated. So firewire_ohci and firewire_core are loaded when I plug in the camera. There is no more /dev/raw1394 and /dev/video-0 streams, but now there are /dev/fw0 and /dev/fw1.
When I run Coriander, I receive: Erreur de segmentation (core dumped)
If I create the following link: ln -s /dev/fw1 /dev/raw1394
[Code]....
View 2 Replies
View Related