LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2021, 06:12 AM   #1
harald_sdt
LQ Newbie
 
Registered: Feb 2011
Location: Cologne / Germany
Posts: 8

Rep: Reputation: 0
GTK3+ | draw cairo object by button-click


The cairo_arc is only visible after button-click and additional mouse-click outside the window. Don't know why mouse-click outside the window is necessary .

cairo_gtk.txt
 
Old 01-18-2021, 05:55 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Mouse click outside the window is not necessary here running your program under fvwm window manager. The circle appears as soon as I click the button -- which is odd in itself as you don't appear to connect a button click to a redraw, so it's clearly being done as a side effect of the rendering of the widgets in some way.

If it's not rendering until you change focus under whatever window manager you're using then my guess is you need some sort of flush, either in cairo itself, or perhaps something like a gtk_widget_queue_draw() or some such. I'm not that familiar with gtk/cairo interactions, so I may be off the mark here, but as no one else has responded, I thought I'd stick my oar in (for what little its worth).
 
2 members found this post helpful.
Old 01-20-2021, 03:06 AM   #3
harald_sdt
LQ Newbie
 
Registered: Feb 2011
Location: Cologne / Germany
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for this helpful answer. Under the gnome window manager it works only with the button click outside the window. But I followed your advice and added "gtk_widget_queue_draw(pointer_01)" to the callback function of the buttonclick. Now it works fine, also under gnome windows manager.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cairo build fails at cairo-analysis-surface.lo CME2 Linux - Newbie 2 12-15-2017 08:10 PM
Computer detecting right-click as left-click, left-click as left-click and middle with 2 fingers pressed as right-click Festerdam Linux - Newbie 5 06-19-2017 05:41 PM
[SOLVED] cairo image refresh draw darthaxul Programming 3 01-30-2011 01:13 AM
pckage "cairo" required by cairo" not found barunparichha Linux - Software 4 06-25-2008 08:29 AM
make thumb button/third button double-click taboom Linux - Hardware 0 03-20-2006 02:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration