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 Aug 28, 2014 7:06 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How do you Get postion of a Fixed widget?
PostPosted: Sat Oct 15, 2011 7:56 am 
Offline
GTK+ Geek

Joined: Wed Mar 18, 2009 2:26 pm
Posts: 62
I Have two fixed widgets nested one inside the other.
FIXED1 is in the Window.
And FIXED2 is at position 20, 30 inside FIXED1.
How do you get the position of FIXED2.
I have not found any function to return the x and y cordinates of a fixed widget.

_________________
Hello, העלו, Здравствулте!


Top
 Profile  
 
 Post subject: Re: How do you Get postion of a Fixed widget?
PostPosted: Thu Oct 20, 2011 9:50 am 
Offline

Joined: Fri Sep 09, 2011 12:00 pm
Posts: 1
Location: India
Use GtkAllocation.

we can get the x & y allocation of a widget using GtkAllocation object

EX:
widget->allocation.x
widget->allocation.y

these two will give you the x & y co-ordinate of a widget allocated on its parent


Top
 Profile  
 
 Post subject: Re: How do you Get postion of a Fixed widget?
PostPosted: Thu Oct 20, 2011 10:14 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hi,

The use of your example
Code:
widget->allocation.x
widget->allocation.y

Has been deprecated for a long time now, and has now been removed from GTK+ 3.

To obtain the GtkAllocation please use
Code:
void                gtk_widget_get_allocation           (GtkWidget *widget,
                                                         GtkAllocation *allocation);
to obtain a copy of the GtkAllocation. You can then get the x and y coordinates from there. This function has been in GTK+ from version 2.18 (September 2009)

E.

_________________
E.


Top
 Profile  
 
 Post subject: Re: How do you Get postion of a Fixed widget?
PostPosted: Tue Oct 25, 2011 9:30 pm 
Offline

Joined: Fri Oct 21, 2011 10:17 pm
Posts: 1
Location: Hollywood, Florida, USA
I have used this but still it misses.



document.ontouchstart = function(event) {
// event.preventDefault();
//$('#nav').hide();

if(event.target.tagName == 'a' || event.target.tagName == 'A')
{
////Do nothing on navigation click
}
else{
$('#nav').hide();
window.setTimeout(showNav,500);
}


/*for(var i in event)
{
alert(i+ ' :' + event[i]);
}*/


};

function showNav(){
$('#nav').show();
}
business development


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

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 3 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