RE : RE : GooCanvas : Clipboard copy



Hi,

>That's because the text is in a GtkLabel widget. If it was a
GooCanvasText item it would work.

I have modified the sample to show a GooCanvasText at location 100, 100.

The code is the following :

static void
add_widget_clicked (GtkWidget *button, gpointer data)
{
  GooCanvasItem *root, *witem;
  GtkWidget *widget;

  if (num_added_widgets % 2)
    widget = gtk_label_new ("Hello World");
  else
    widget = gtk_entry_new ();

  root = goo_canvas_get_root_item (GOO_CANVAS (canvas));
  witem = goo_canvas_widget_new (root, widget,
				 num_added_widgets * 50,
				 num_added_widgets * 50,
				 200, 50, NULL);

  added_widget_items = g_list_prepend (added_widget_items, witem);
  num_added_widgets++;

  witem = goo_canvas_text_new(root,
	
"Hello World",
	
100,
	
100,
	
-1,
	
GTK_ANCHOR_CENTER,
	
"font", "Sans 10px",
	
NULL);
}

In the function on_clipboard_copy(), I have created a rectangle painted
with cairo_set_source_rgb(cr, 1.0, 1.0, 1.0) (as you propose).

The result is very strange. The background is white and the text too.
This the result (in attachement).

The red rectangle contains the text "orld" (in white). The rest of the
text is lost in the white background.

What do you think about this color ?

Cyril

Attachment: widgets-demo-clipboard-white.jpg
Description: JPEG image



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]