We solve problems

  • Count on us to deliver high quality tailor-made software
  • We provide training on TDD, clean code, refactoring and JavaScript
  • We are committed consultants
  • We help teams deliver value

Archive for September, 2008



This sample shows how to create a splash screen using Monodelop and Gtk#. Create a new Window. Within its properties, unset the Decorator so that it won't have any title bar. Add a HBox or VBox inside the window with only one placeholder. Add a button inside and select Custom in the Button Type under the Button Properties. Add an image inside the button.
Source code that makes it work:

  1.  
  2. using System;
  3. using System.Threading;
  4.  
  5. namespace sigaDesktopClient
  6. {
  7. public partial class MainWindow : Gtk.Window
  8. {
  9.  
  10. public MainWindow() :
  11. base(Gtk.WindowType.Toplevel)
  12. {
  13. this.Build();
  14. ThreadStart tStart = new ThreadStart(this.EndSplash);
  15. Thread t = new Thread(tStart);
  16. t.Start();
  17. }
  18.  
  19. public void EndSplash()
  20. {
  21. Thread.Sleep(2000);
  22. Gtk.Application.Invoke(
  23. delegate (object sender, EventArgs args)
  24. {
  25. StartApplication();
  26. }
  27. );
  28. }
  29.  
  30. private void StartApplication()
  31. {
  32. // WRITE THE CODE TO OPEN THE MAIN GUI HERE
  33. this.Hide();
  34. }
  35.  
  36. protected virtual void OnClick (object sender, System.EventArgs e)
  37. {
  38. StartApplication();
  39. }
  40.  
  41. protected virtual void OnEntered (object sender, System.EventArgs e)
  42. {
  43. StartApplication();
  44. }
  45. }
  46. }
  47.