GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Dec 18, 2014 4:24 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cursor rending problems (errors in gdkdrawable / MaskBlt)
PostPosted: Wed Dec 28, 2011 3:29 pm 
Offline

Joined: Wed Dec 28, 2011 3:25 pm
Posts: 1
In building a recent Windows version of Xournal under the latest GTK
win32, I have run into difficulties rendering cursors due to the
following errors:

(xournal.exe:3512): Gdk-WARNING **: gdkdrawable-win32.c:711: MaskBlt
failed: The operation completed successfully.
(xournal.exe:3512): Gdk-WARNING **: gdkdrawable-win32.c:714:
SelectObject failed: The operation completed successfully.

The code that renders cursors uses a GdkGC to draw a bitmapped cursor
onto a pixmap like so:
gdk_gc_set_stipple(gc, source);
gdk_gc_set_clip_mask(gc, mask);
gdk_draw_rectangle(rgb_pixmap, gc, TRUE, 0, 0, width, height);

The errors above appear during a call to gdk_draw_rectangle.

The code I am working with was last known to compile (with win32)
under GTK 2.16.5

Incidentally, that code itself is a workaround to deal with GTK bug
541377 (https://bugzilla.gnome.org/show_bug.cgi?id=541377).

I have no previous experience dealing with cursors in GTK, so I am
stuck at the moment. Could someone point me to a way of rendering cursors from bitmaps that would work under Win32? The docs for most of the GdkGC functions say that they are deprecated in favor of Cairo; is there a way to use some Cairo functions to do the cursor rendering?

--Leo


Top
 Profile  
 
 Post subject: Re: Cursor rending problems (errors in gdkdrawable / MaskBlt
PostPosted: Mon Jan 02, 2012 11:18 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Yes these have been depreciated and you would be much better using cairo (because its also been so long depreciated, a lot of new users on this forum would have no knowledge of gdk's drawing and you'll find more support for any problems you'll run into using cairo). You'll find the documentation and examples at http://www.cairographics.org though they're not quite as good as the gtk resources. There's also a tutorial on using cairo to render customised widgets on the gtk site.
I have no idea what stipple is so can't help you in translating, but it sounds like an easy enough job to mask a cursor onto a bitmap.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group