GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GtkDrawingArea and Z-Order

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
batimus



Joined: 24 Sep 2007
Posts: 1

PostPosted: Mon Sep 24, 2007 1:51 pm    Post subject: GtkDrawingArea and Z-Order Reply with quote

Hello,

I'm trying to place GtkImage widget over GtkDrawingArea ( both are placed in GtkFixed widget). everything looks alright, except the order of widgets. no matter which of them is placed first, DrawingArea contents are always on the top of widgets. is there any way to pop GtkImage over the DrawingArea ?

here is a code snippet I use to draw this:

void scroller_space_redraw(GtkWidget *widget, gpointer data) {
gdk_draw_rectangle(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
}

.............

scroller_space = gtk_fixed_new();
gtk_widget_show(scroller_space);
gtk_container_add(GTK_CONTAINER(scroller_eb), scroller_space);

scroller_background = gtk_drawing_area_new ();
g_signal_connect (G_OBJECT (scroller_background), "expose_event", G_CALLBACK (scroller_space_redraw), NULL);
gtk_widget_set_size_request(scroller_background, th.scrollbar1_width - 2, height - th.scrollbar1_up_height - th.scrollbar1_down_height);
gtk_fixed_put(GTK_FIXED(scroller_space), scroller_background, 1, 0);

scroller = gtk_image_new_from_file(th.scroller1);
gtk_widget_show(scroller);
gtk_fixed_put(GTK_FIXED(scroller_space), scroller, 0, 30);

.......................

thanks a lot and best regards

Batimus.
Back to top
iltgcl



Joined: 04 Sep 2007
Posts: 2

PostPosted: Tue Sep 25, 2007 2:54 am    Post subject: Reply with quote

The Fixed container 's behavior is always strange.My solution is that you use the same widget to implement widget overide in fixed widget.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP