Reply
Thread Tools
Posts: 5 | Thanked: 1 time | Joined on Jun 2007
#1
I want to develop a small application which conectes to some site for nokia n800 on maemo platform. like a button to start the conection process and some kind of text area to display the content of the site.

pls give me some help.

rgds,
henk
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#2
That should be easy enough in Python : look at TahitiBob's launcher app, you can probably reuse 90% of it to do what you want.
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#3
It will take about this much code in python, oh, and adding a text area (or whatever you need):

Code:
import os,urllib,time,string

                    urladdress="http://www.cnn.com"
		    urladdress=urllib.urlencode(urladdress) 
		    print "opening" + urladdress

		    try:
			    sock = urllib.urlopen(urladdress)
			    htmlSource = sock.read()
		    except:
			    print "unable to get socket"
			    print sys.exc_info()[0]
 
Posts: 5 | Thanked: 1 time | Joined on Jun 2007
#4
Originally Posted by konttori View Post
It will take about this much code in python, oh, and adding a text area (or whatever you need):

Code:
import os,urllib,time,string

                    urladdress="http://www.cnn.com"
		    urladdress=urllib.urlencode(urladdress) 
		    print "opening" + urladdress

		    try:
			    sock = urllib.urlopen(urladdress)
			    htmlSource = sock.read()
		    except:
			    print "unable to get socket"
			    print sys.exc_info()[0]
yes right but I am specified to use maemo platform. curentely i have installed maemo 3.1 on Debian. and this thing was kind of urgent.

any help will be apriciated
henk
 
fpp's Avatar
Posts: 2,853 | Thanked: 968 times | Joined on Nov 2005
#5
Well, Python runs just fine under Maemo, it is even packaged by the good folks at INdT and comes ready-to-use with pyGTK and pyGame. You can use either of these to make a GUI for your app, or make it HTML and show it in the browser.
 
Posts: 5 | Thanked: 1 time | Joined on Jun 2007
#6
Originally Posted by fpp View Post
Well, Python runs just fine under Maemo, it is even packaged by the good folks at INdT and comes ready-to-use with pyGTK and pyGame. You can use either of these to make a GUI for your app, or make it HTML and show it in the browser.
yes but for some spesifc reason can any one help me to get the code in a format like the following ?

#include <hildon-widgets/hildon-color-selector.h>
#include <hildon-widgets/hildon-color-button.h>
#include <hildon-widgets/hildon-program.h>
#include <gtk/gtk.h>

/* Application UI data struct */
typedef struct _AppData AppData;
struct _AppData {
HildonProgram *program;
HildonWindow *window;
};

void color_button_clicked(GtkWidget * widget, gpointer data)
{
GdkColor *new_color = NULL;
g_object_get(widget, "color", &new_color, NULL);
}

void ui_show_color_selector(GtkWidget * widget, AppData * appdata)
{
GdkColor *current_color;
const GdkColor *new_color;
GtkWidget *selector;
gint result;

/* Create new color selector (needs access to HildonWindow!) */

selector = hildon_color_selector_new(GTK_WINDOW(appdata->window));

/* Set the current selected color to selector */
hildon_color_selector_set_color(HILDON_COLOR_SELEC TOR(selector),
current_color);

/* Show dialog */
result = gtk_dialog_run(GTK_DIALOG(selector));

/* Wait for user to select OK or Cancel */
switch (result) {
case GTK_RESPONSE_OK:

/* Get the current selected color from selector */
new_color = hildon_color_selector_get_color
(HILDON_COLOR_SELECTOR(selector));

/* Now the new color is in 'new_color' variable */
/* Use it however suitable for the application */

gtk_widget_destroy(selector);
break;

default:
........................................
...............................................


this is just part of a color selector program

tanks for any help
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#7
that is c code, and you need to start digging at c code examples on the web. Try googling for such examples. If you want to make a simple program, you really should reconsider using python. And if you absolutely need to use c, try googling around for a suitable code example.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:07.