Re: How to get and set the width/height of a label?



Yes,it does implement the method.But it return value 24 for the label,which i can't get what is means.

On Fri, Aug 7, 2009 at 7:05 PM, Gerald Britton <gerald britton gmail com> wrote:
Does the Python wrapper implement the __sizeof__ special method?  For built-in objects, this is the normal way to get the size.


On Thu, Aug 6, 2009 at 10:43 PM, Jorge Opaso Pazos <jorge opaso gmail com> wrote:
This works (C):

int main(int a_argc,char **a_argv)
{
GtkWidget *l_label;
GtkRequisition l_req;


gtk_init(&a_argc,&a_argv);


l_label = gtk_label_new("hello");
memset(&l_req,0,sizeof(GtkRequisition));
gtk_widget_size_request(l_label,&l_req); // not gtk_widget_get_size_request


printf("%d %d\n",l_req.width,l_req.height);


return 0;
}

Output: 31 17

Maybe in python is: gtk.Label.size_request() 

Atentamente,

Jorge Opaso Pazos
AUTOLogic LTDA




El 06-08-2009, a las 21:33, cbx escribió:

I would like to know how to get and set the size of a label.
There seems no answer in the pygtk API(me using Python currently). gtk.Label.get_size_request() only return (-1,-1).
Google doesn't give much information too. _______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list




--
Gerald Britton



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