Questions tagged [drawingarea]

DrawingArea is a GTK widget for custom user interface elements.

41 questions
8
votes
1 answer

GTK3 Drawing area tutorial does not seem to exist?

I've been learning GTK3 on my own and I'm now stuck on Gtk.DrawingArea. As with most widgets and functions in GTK, there seems to be a lack of updated documentation and tutorials on this. For reference as to what I've found(hopefully this will help…
Swashy
  • 177
  • 3
  • 6
3
votes
1 answer

Resizing a Gtk.DrawingArea in PyGtk3

Please run the code below to get something like this: Basically, I've set up a Gtk.DrawingArea, which is inside a Gtk.Viewport, which is also in a Gtk.Scrolledwindow. In said DrawingArea I draw an image, and with the 2 buttons you can scale said…
deko
  • 463
  • 1
  • 6
  • 17
3
votes
2 answers

In GTK+3, how do I get a drawingarea to respond to mouse events?

In GTK+3, how do I get a drawing_area to respond to mouse events? In main() function I declared my drawing_area: GtkWidget *drawing_area; Then I connected the drawing_area with the mouse click signal: g_signal_connect(drawing_area,…
PintoDoido
  • 1,011
  • 16
  • 35
3
votes
1 answer

Gtkmm draw line with mouse events

I wish to draw a line using mouseevents on Gtk::DrawableArea. What I want is something like: Click on Line Button to activate line event Select first point(already drawn) in the drawingarea Now Select second point(again already drawn) in the…
Gurjot Bhatti
  • 977
  • 1
  • 10
  • 24
3
votes
2 answers

GTK and SFML 2 Blurred sprites

I want to use GTK+ and SFML 2.0 together. I created a simple window to test that, but doesn't work well. Sprites are blurred. Below is a screenshot describing the problem. /edit: The window renders only the first pixel of a texture. It should look…
poxip
  • 909
  • 8
  • 25
2
votes
1 answer

How to display an SVG image in GTK DrawingArea without losing quality when scaling?

I want to display an SVG image in a GTK DrawingArea without losing quality when scaling. Currently, I am using the following code: fn build_ui(application: >k::Application) { let window = gtk::ApplicationWindow::new(application); …
2
votes
2 answers

Get Gtk::DrawingArea size, before signaling draw

I want to draw some frames, one by one in a Gtk::DrawingArea. At the beginning of application, I need to get the size of DrawingArea, to allocate a RGB buffer, hewever, DrawingArea::get_width() and DrawingArea::get_height() return 1. My code is…
Null
  • 349
  • 2
  • 12
2
votes
1 answer

Scrolling a drawingarea

For information: I use Ada as programming language, The Windowing software is Gtk and GtkAda. I have a drawing on a drawing area that sometimes not fits witkin my window, not even if I use full screen. Therefore I need to have a scrolled area. I use…
ldries46
  • 61
  • 1
2
votes
1 answer

Gtk.DrawingArea blank when attached to Gtk.Grid

(This is my first post, sorry if I do something wrong...) I am writing a program in Vala with which one can design a classroom. I have decided to use GTK for the GUI (Vala integrates well with this), and Cairo to draw the classroom diagram (GTK…
Albert Tomanek
  • 387
  • 4
  • 13
2
votes
0 answers

Gtkmm - Save Gtk::DrawingArea to file

I have a Gtk::DrawingArea which is inside a Gtk::ScrolledWindow. I'm trying to save the DrawingArea to a file, so I do the following in the DrawingArea signal_draw()'s handler : Cairo::RefPtr surf = context -> get_target(); surf ->…
Chrischpo
  • 145
  • 1
  • 11
2
votes
2 answers

GTK3+ (3.14) drawing area on scrolledwindow

It makes a while that I've been trying to put a drawing area on a scrolled window. I've been reading articles about pygtk and C solutions but I think that they are not working in pyGobject. I made a minimal example: from gi.repository import Gtk,…
user3672754
2
votes
1 answer

How to set the background color of a pygtk window

I am trying to set the background color for a pyGtk window which has a single DrawingArea widget. With this code I always get a random color everytime I launch the script: widget = gtk.DrawingArea() widget.show() window =…
musicamante
  • 41,230
  • 6
  • 33
  • 58
2
votes
1 answer

GtkWidget draw event fired mutliple times

I have been scratching my head on Why is below code triggers on-draw callback three times as opposed to just once. #include #include using namespace std; void on_draw(){ cout << "drawing"<
duckduckgo
  • 1,280
  • 1
  • 18
  • 32
2
votes
1 answer

How To Make Mini Example For DrawingArea Display Something

I've written a mini example for DrawingArea which, when started, displays nothing. If I insert a raw_input() just for waiting for a keyboard press at a specific place, it functions, so this is a workaround. Here's the code: #!/usr/bin/env…
Alfe
  • 56,346
  • 20
  • 107
  • 159
1
vote
1 answer

How to get cursor position on hover in GTK-rs drawing area?

I am working on a GTK-rs application in Rust that includes a drawing area. I am trying to print the position of the cursor to the command line whenever the user hovers over the drawing area. I have tried using the motion notify event with a callback…
petios
  • 25
  • 6
1
2 3