Thanks. I added the following lines as told. Now I am getting a window but <br>1) it is not circular shaped although I am using X shape extension API <br>2) it is not accepting any input. XNextEvent() still hangs<br><br>attached is the modified program. Anything else I need to add<br>
<br>Also, can anyone help me to understand <br>what difference does it make if we call XSelectInput or XShapeSelectInput?<br> Do we always need to use XShapeSelectInput if we have set a shape on the<br>
window? Or are there cases in which we would want to use XSelectInput with a<br>
shaped window?<br><br>Regards & thanks in advance<br><br><div class="gmail_quote">On Tue, Feb 1, 2011 at 7:15 AM, Pat Kane <span dir="ltr"><<a href="mailto:pekane52@gmail.com">pekane52@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You should add a line like this too:<br>
XSelectInput(dsp, win, ExposureMask|ButtonPressMask|ButtonReleaseMask );<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Jan 31, 2011 at 9:39 AM, Pat Kane <<a href="mailto:pekane52@gmail.com">pekane52@gmail.com</a>> wrote:<br>
> Add this line just before the event loop:<br>
> XMapWindow(dsp, win);<br>
> Pat<br>
> ---<br>
><br>
><br>
><br>
> On Mon, Jan 31, 2011 at 2:05 AM, Prasanta Sadhukhan<br>
> <<a href="mailto:psadhukhan@gmail.com">psadhukhan@gmail.com</a>> wrote:<br>
>> Thanks for the pointer. I saw that the example use widget API through<br>
>> XCreateManagedWIdget APIs.<br>
>> Are this required to use the shape extension API to work?<br>
>><br>
>> I wanted to use the shape API without this if possible. I tried a small<br>
>> example of creating a circular window which will have 2 diagonal line in it<br>
>> and the window should close when any button is pressed inside it. Attached<br>
>> is the c program I tried but it is not creating any window and is hanging<br>
>> inside XNextEvent() call<br>
>> Can anyone please point to me as to what is wrong in this program. I am a<br>
>> newbie to X-programming<br>
>><br>
>> Also, one more question regarding events is<br>
>> what difference does it make if we call XSelectInput or XShapeSelectInput?<br>
>> Do we always need to use XShapeSelectInput if we have set a shape on the<br>
>> window? Or are there cases in which we would want to use XSelectInput with a<br>
>> shaped window?<br>
>><br>
>> Thanks in advance<br>
>> Prashant<br>
>><br>
>> On Mon, Jan 24, 2011 at 9:14 PM, Alan Coopersmith<br>
>> <<a href="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</a>> wrote:<br>
>>><br>
>>> On 01/24/11 03:34 AM, Prasanta Sadhukhan wrote:<br>
>>> > Thanks for the information. Is there any link which shows an example of<br>
>>> > how to<br>
>>> > use this APIs for example, if I want to create a rounded-rect window.<br>
>>><br>
>>> See the oclock sources, which use the shape extension to draw a circular<br>
>>> clock<br>
>>> window:<br>
>>><br>
>>> <a href="http://cgit.freedesktop.org/xorg/app/oclock/tree/" target="_blank">http://cgit.freedesktop.org/xorg/app/oclock/tree/</a> or<br>
>>> <a href="http://www.x.org/releases/individual/app/oclock-1.0.2.tar.bz2" target="_blank">http://www.x.org/releases/individual/app/oclock-1.0.2.tar.bz2</a><br>
>>><br>
>>> --<br>
>>> -Alan Coopersmith- <a href="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</a><br>
>>> Oracle Solaris Platform Engineering: X Window System<br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> <a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
>> Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
>> Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
>><br>
><br>
</div></div></blockquote></div><br>