Reply
Thread Tools
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#1
I currently use the maemo virtual image to develop but I have a problem as I want to use a app menu. I have set the titlename but it refuses to show up. Is there any way to solve this and how?


Yours Lullen
 
Posts: 61 | Thanked: 43 times | Joined on Aug 2008
#2
Originally Posted by Lullen View Post
Is there any way to solve this and how?
Show the source code.
 
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#3
 
Andre Klapper's Avatar
Posts: 1,665 | Thanked: 1,649 times | Joined on Jun 2008 @ Praha, Czech Republic
#4
That's not source code, that's API documentation, hence the request still stands.
__________________
maemo.org Bugmaster
 
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#5
if you scroll down a bit you see a example, i use the same code for titlebar and window

Code:
static void
show_new_window (void)
{
    GtkWidget *win;

    win = hildon_stackable_window_new ();

    // ... configure new window

    gtk_widget_show (win);
}

int
main (int argc, char **argv)
{
    GtkWidget *win;
    GtkWidget *button;

    gtk_init (&argc, &args);

    win = hildon_stackable_window_new ();
    gtk_window_set_title (GTK_WINDOW (win), "Main window);

    // ... add some widgets to the window

    g_signal_connect (button, "clicked", G_CALLBACK (show_new_window), NULL);
    g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL);

    gtk_widget_show_all (win);
    gtk_main ();

    return 0;
}
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#6
Where's your source code?

That code won't even compile:
gtk_window_set_title (GTK_WINDOW (win), "Main window);
 
Posts: 61 | Thanked: 43 times | Joined on Aug 2008
#7
I added hildon-program.h and gtkmain.h includes. Removed show_new_window function and button widget and it's signal_connect. Also fixed gtk_init and that missing quotation mark.
Compiled with gcc -o proggis c.c `pkg-config gtk+-2.0 hildon-1 --cflags --libs` -Wall

Works fine.
I think you are beyond any help.

http://pastebin.com/f56dc402

Last edited by harriva; 2009-10-28 at 18:29.
 
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
 
Posts: 61 | Thanked: 43 times | Joined on Aug 2008
#9
Since you still won't give enough code to properly test it I quess the problem in using both g_set_application_name and gtk_window_set_title with different parameters.
 
Posts: 289 | Thanked: 101 times | Joined on Oct 2009
#10
I thought the application name was different to the window title. But I really start to feel that maemo is not anything for me. I usualy program java and it is so much easier to get going with because the api is correct. I will forget about hildon and try Qt instead. Maybe I should start a new thread but I hope I get some answers here.

Where can I find basic stuff examples about Qt?
What I am trying to make is not that complicated. In the begining it is just a cockbook where I can choose to see recipes of food/drinks and ingredients. And when I choose a recipe I want to see ingredients, a how-to and the price/portion. Of course I want to add new recipes and ingredients in the program. So what I need to learn is how to use:
*listView(or treeView as I read in the pdfs)
*appmenu
*database(some how this seems to be the easiest)

PS Is it the community or nokia that makes the api documentation? Will it get updated?
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:46.