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

Get Widget's actual size?



Hi.

I'm trying to get the actual size of a widget.
As far as I can tell, "gtk_widget_size_request"
returns the desired size of the widget, not the
actual size of the widget on the screen, whereas
"gtk_widget_size_allocate" appears to set the
size of the widget.

So, right now my code looks like this (which appears
wrong)

...
  gtk_widget_size_request(label,&req);
  gtk_widget_destroy(label)
  entry=gtk_entry_new();
  gtk_entry_set_text(GTK_ENTRY(entry),label_text);
  gtk_widget_set_uszie(entry,req.width,req.height);
  gtk_container_add(GTK_CONTAINER(event_box),entry); 
  gtk_widget_show(entry);
...


What I'm trying to do is allow the user to click
on a "label", and have that replaced by an "entry",
but right now when I'm adding the entry, it resizes
the window it's in, which is something I'd like to
avoid.


Alternatively, is there a way to avoid drawing the
outline around the a GtkEntry?

-jeremy




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