View Single Post
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#8
Oh I'm sorry! I was sure that I took that code. Btw how comes that there are alot of examples in the API documentation that won't even work? I have always learned new things by example but both hildon and qt are like this! This makes it so much harder to learn this stuff... I have been sitting 50h+ with hildon and qt and because almost all examples are not working I still have no clue about how to do things. For example in qt I have no clue how to make a treeview because I want to make a model and that is not working sice model->setModel() (or how it exactly is) does not even exist and they use it everywhere in the examples.

But now back to topic, I did use a example from the virtual image. The only thing I added is the gtk_window_set_title("kokbok"); But if you think its stupid to learn this instead of Qt(it feels more complete with examples) please tell me or give me a link where I can see how to use hildon with Qt.

Code:
int main(int argc, char *argv[]) {
    HildonProgram *program;
    HildonWindow *window;
    GtkWidget *button;

    /* This is called in all Hildon applications. Arguments are parsed
    * from the command line and are returned to the application. */
    hildon_gtk_init (&argc, &argv);

    /* Get an instance of HildonProgram. It is an object used to represent
    * an application running in the Hildon framework.               */
    program = HILDON_PROGRAM( hildon_program_get_instance () );

    /* Set the program title */
    g_set_application_name("Hello World");

    /* create a new hildon window */
    window = HILDON_WINDOW( hildon_window_new () );
    gtk_window_set_title(GTK_WINDOW(window), "Kokbok");

    /* Registers a window as belonging to the program */
    hildon_program_add_window (program, window);
PS. Where is a good place to learn how things work? As the API documentaion is not reliable