[Gtk-sharp-list] Fwd: Re: Equivalent to Windows.Forms DateTimePicker
claunia at claunia.com
Sun Sep 5 08:06:26 EDT 2010
El 04/09/2010, a las 22:03, Jacek Rużyczka escribió:
> ---------- Forwarded Message ----------
> Subject: Re: [Gtk-sharp-list] Equivalent to Windows.Forms DateTimePicker
> Date: Samstag 04 September 2010, 22:12:59
> From: Jacek Rużyczka <stacheldraht at interia.pl>
> An: Natalia Portillo <claunia at claunia.com>
> Hi ^^
> Am Samstag 04 September 2010 21:37:50 schrieben Sie:
>> However, if you can explain me how to add a widget on the constructor I may
>> be able to add the HollyWidgets one which license should be compatible
> Well, when you create a new window / dialog / widget with MD, it creates a
> constructor with a this.Build() call inside. After this call you can referance
> all siblings of your Gtk# container, including sub-containers like VBoxes. So
> you can, for instance, create a new Gtk# widget and add it to your container.
Yes I do that, exactly as following:
public partial class frmDialog : Gtk.Dialog
HDateTime dtpDateTime; // The HollyWidgets date time picker
this.dtpDateTime = new HDateTime();
this.vbox12.Add(dtpDateTime); // vbox12 is a VBox created by MonoDevelop designer that contains two slices, one with a HBox inside and the other left void
Then I invoke it as:
frmDialog _frmDialog = new frmDialog();
But the vbox12 stays the same as in the designer, only the HBox inside the other slice void.
Am I doing anything wrong here?
>> Also, just in case, do you know how to execute code on dialog load?
>> On Windows.Forms there is the OnLoad event, but in GTK+ I tried with shown,
>> mapped, realized, without sucess, they are never invoked, and I need that
>> code to execute EXACTLY on the dialog.Run() not on the new dialog() or the
>> UI will appear crashed during long time.
> You're right...the signals you mentioned are never raised. For myself, I rely
> on the FocusGrabbed signal. I can't tell you whether it's gonna be the ideal
> choice for you, but try.
With a class-wide bool value to check the code is executed just once should work if FocusGrabbed is automatically, does not require the user focusing the dialog manually.
Anyway, that events never being raised is a bug.
More information about the Gtk-sharp-list