[Gtk-sharp-list] Two hopefully simple questions

Adam Williams awilliam at whitemice.org
Sat Apr 21 09:42:47 EDT 2007


> > Would a VBox with an HBox in every row do this?
> No, a HBox doesn't do the trick. If I put them into a HBox I get two equally 
> sized entry fields. I even tried to put each Entry into an Alignment and 
> those into the HBox.


Widgets are dynamically sized, which is a good thing,  but I think I see
what you are getting at.   If you have an Entry that should only be of a
certain length try setting the WidthChars property.

> > You could just put the image in with a pixbuf and then capture the
> > clicks in the tree, and if they clicked on the row/column containing the
> > pixbuf act like it is a button.
> How can I capture clicks in the tree? I didn't find any method / event to do 
> this. It's a very powerfull widget but like one can see through all the 
> questions about it here - it's not easy to use for the first time. :-)


You capture the button press event,  and specify "GLib.ConnectBefore" on
the event handler -

/* @brief Handle click events on the tree views */
[GLib.ConnectBefore]
protected void OnButonPressEvent(
  object sender, 
  ButtonPressEventArgs args)
{
...
}

You can get what was clicked from the TreeIter;  this was discussed not
to long ago on this list.

http://www.nabble.com/Determining-if-a-specific-cell-in-a-TreeView-has-been-clicked--tf3545126.html#a9935446



More information about the Gtk-sharp-list mailing list