Programming :: Invoke A ButtonPress Event Using XLib?
Nov 17, 2010I'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 RepliesI'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 RepliesAfter upgrading to 11.2, I get the following error when starting any xclient. Worse, its usually repeated a few times for each client.
Xlib: extension "Generic Event Extension" missing on display <my_ip>
I get this both when using Xming and nomachine.
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]....
I have to execute certain commands (like shutdown Tomcat) on several servers so I'm using a loop and ssh. I put the server's IP on a CSV file which I parse, execute the commands for each line and send the output to a file. The problem is that after processing one line the program stops execution. I wonder if someone could lend me a hand with this, I'm new in bash scripting and I ran out of ideas.
The CSV (servers.csv) file looks like this:
Code:
192.168.254.5:Server 1
192.168.254.6:Server 2
...
And the script looks like this:
Code:
#!/bin/bash
while IFS=: read ip name
do
sshpass -p "pass" ssh -o "StrictHostKeyChecking no" root@"$ip" 'sh <CATALINA_BASE>/bin/shutdown.sh' >> output.log
done < servers.csv
My main problem right now is doing floating point arithmetic within a bash script, with variables.Right now I have a folder called "myExamples" with a script called "run_example" that runs with no issues.I plan to(1) create many folders inside [myExamples], that are named [example10] [example11]...each containing an identical copy of (run_example),(2) modify Line 172 of each copy of (run_example)...in one copy, it would be 3.00, the next copy would have 3.05, etc. (This part doesn't work!)How can I use the available calculator bc code to do floating point operationsMy code is below -
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/(.*)/.*/1/'` # extract pathname
[code]....
I have created a glade file which so far have two regions in it:
1) On the right division is a toggle button which calls a C script when enabled.
2) I have a drawing area, in which I would like to plot a point (X-Y scatter plot). The plot should be generated dynamically using a C script. I am not sure how the integration between the two is possible for a drawing area.
In glade what properties of drawing area should I set? eg.expose event, realize etc. I was thinking of using cairo for generating the plot.
I am trying to import variable values from a profile file to a perl program.
I am using the below command for doing it.
Quote:
system (". /opt/bbfb/bin/setbbfbenv $codeset");
the above command does make variable values available to the running perl program..
Can some one help me on this front..
When I try to invoke 'source' command from within a shell script, namely, myscript.sh, I get the following error message code...
View 1 Replies View RelatedI 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...
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 RelatedI 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 RelatedThe 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 RelatedI 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 RelatedI'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
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 RelatedI'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"?
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.
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 RelatedI 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:
I am running a Java application on the command line bash terminal under Mint Debian. I have JDK1.6.0_22 installed 64-bit, and the OS is 64-bit too. I have a few JAR files in the directory and a few native LWJGL libraries. When I run the application using the command line, all works fine.
Lets assume my directory where the files are is called /home/riz/MyGame. I change to that directory and this is the command I use code...
I'm using mq_notify to be notified about events on a message queue. But my registered notifier function is not being called. I'm pasting my code snippet below:
[Code]....
I am trying to write an app that will perform some actions when a network interface is unplugged. Is there a way to get the OS to signal me when a network interface is unplugged. I have looked at DBus but can't figure it out.
View 1 Replies View RelatedWhen i create a new event device (/dev/input/event) it is automatically grabbed by Xorg:
Code:
(II) config/udev: Adding input device Keypad Emulation Driver (/dev/input/event7)
(**) Keypad Emulation Driver: Applying InputClass "evdev keyboard catchall"
[code]....
Is any way to detect a keypress event in a console session? Preferebly without needing the application to be running in the foreground
View 2 Replies View Relatedi need to have the time of occurence for mouse event in xinput,right now i run
Code:
xinput test <device_id> >log.txt
(for finding device_id using xinput list)
[code]...
I know how to deal with a mouse click event like so:
Code:
But was happens when I am dealing with mouse dragging? Will my implementation of mouseDragged() get called for every pixel moved? So I just getX() and getY() like with a mouse click?
Also, in order to know when mouse dragging stops and starts, do I also have to put code in mousePressed and mouseReleased?
How to do so? For starters, I'm not sure there is such an event. Maybe it has something to do with the OS moving through certain run-levels
View 6 Replies View RelatedI'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.
Code:
#! /usr/bin/perl -wT
use strict;
[code]...
My main problem right now is doing floating point arithmetic within a bash script, with variables.Right now I have a folder called "myExamples" with a script called "run_example" that runs with no issues.I plan to(1) create many folders inside [myExamples], that are named [example10] [example11]...each containing an identical copy of (run_example),(2) modify Line 172 of each copy of (run_example)...in one copy, it would be 3.00, the next copy would have 3.05, etc. (This part doesn't work!)How can use the available calculator bc code to do floating point operations?My code is below -
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/(.*)/.*/1/'` # extract pathname
[code]...
When I getch() a key event (UP arrow key), the getch() function return a string of characters that I cannot compare with curses.KEY_UP constant. Here is the code I use :
while True:
w = gb.scrn.getch()
c = chr(w)
otp = 'touche:'+str(w)+' '+str(c)+"
[Code]...
It seems like getch() return three distincts bytes while I would retrieve it with a single ord() instruction in python like describes in curses/python documentation.