[Mono-bugs] [Bug 81211][Nor] New - Problem using SpingButton and Banner Widget

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Mar 22 12:20:17 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tquerci at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81211

--- shadow/81211	2007-03-22 11:20:17.000000000 -0500
+++ shadow/81211.tmp.4437	2007-03-22 11:20:17.000000000 -0500
@@ -0,0 +1,130 @@
+Bug#: 81211
+Product: gtk#
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: maemo
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: tquerci at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Problem using SpingButton and Banner Widget
+
+Using the maemo mono port, I have some problem using SpinButton and Banner 
+with the ShowProgress behaviour.
+
+I try to made the same thing in C and work.
+
+In the testing environment the code work fine, but not on device.
+
+I insert the C# and C code to show this behaviour. 
+
+Note: the problem seems to be related to the method that use floating 
+point data type.
+
+------------ C# Code ------------------------
+using System;
+using GLib;
+using Gtk;
+using Hildon;
+using System.Collections;
+
+namespace HildonSamples {
+
+public class BannerExample : Hildon.Window
+{
+        public BannerExample() :base ()
+        {
+                Hildon.Banner banner = null;
+
+                this.Destroyed += delegate {Application.Quit ();};
+                this.Title = "BannerExample";
+                this.BorderWidth = 6;
+                Gtk.VBox vbox_main = new VBox (false,0);
+                Gtk.Label lbl=new Gtk.Label("Sample...");
+                vbox_main.PackStart (lbl);
+                Gtk.SpinButton spnButton = new Gtk.SpinButton(1.0, 5.0, 
+0.5);
+                vbox_main.PackStart (spnButton);
+
+                this.Add (vbox_main);
+
+                banner = (Hildon.Banner) Banner.ShowProgress (this, 
+null, "Info with progress bar");
+                banner.Fraction = (double)0.2;
+
+                this.ShowAll();
+        }
+
+        public static void Main (string[] args)
+        {
+                Application.Init ("mono",ref args);
+                Hildon.Program prog = Hildon.Program.Instance;
+                prog.AddWindow ( new BannerExample ());
+                Application.Run();
+        }
+}
+
+}
+
+---------------- C Code ----------------
+/* Includes */
+#include <hildon-widgets/hildon-program.h>
+#include <hildon-widgets/hildon-banner.h>
+#include <gtk/gtk.h>
+
+/* Main application */
+int main(int argc, char *argv[])
+{
+    /* Create needed variables */
+    HildonProgram *program;
+    HildonWindow *window;
+    GtkWidget *main_vbox;
+    GtkWidget *banner = NULL;
+
+    /* Initialize the GTK. */
+    gtk_init(&argc, &argv);
+
+    /* Create the hildon program and setup the title */
+    program = HILDON_PROGRAM(hildon_program_get_instance());
+    g_set_application_name("App Title");
+
+    /* Create HildonWindow and set it to HildonProgram */
+    window = HILDON_WINDOW(hildon_window_new());
+    hildon_program_add_window(program, window);
+
+    /* Add vbox to hildon window */
+    main_vbox = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(window), main_vbox);
+
+    banner = hildon_banner_show_progress(GTK_WIDGET(window), NULL, "Info 
+with progress bar");
+    hildon_banner_set_fraction(HILDON_BANNER(banner), 0.2);
+
+    GtkWidget* label=gtk_label_new("Sample\nText\nIn\nLabel");
+    gtk_box_pack_start(GTK_BOX(main_vbox), label, TRUE, TRUE, 0);
+
+    /* Add SpinButtonWidget to test it */
+    GtkWidget* spin_button = gtk_spin_button_new_with_range(1.0, 10.0, 
+0.5);
+    gtk_box_pack_start(GTK_BOX(main_vbox), spin_button, FALSE, FALSE, 0);
+
+    /* Connect signal to X in the upper corner */
+    g_signal_connect(G_OBJECT(window), "delete_event",
+    G_CALLBACK(gtk_main_quit), NULL);
+
+    /* Begin the main application */
+    gtk_widget_show_all(GTK_WIDGET(window));
+    gtk_main();
+
+    /* Exit */
+    return 0;
+}
+
+--------------------------------------------------


More information about the mono-bugs mailing list