Mercurial > pidgin
view console/libgnt/test/focus.c @ 14089:10e8eb6a4910
[gaim-migrate @ 16712]
Pretty large commit here. Basically I got sick of having to verify
that gc is still valid on all the callback functions for
gaim_proxy_connect(). The fix for this for gaim_proxy_connect() to
return something that allows the connection attempt to be canceled.
It's not quite there yet, but this is a good first step. I changed
gaim_proxy_connect() to return a reference to a new
GaimProxyConnectInfo (this used to be called PHB). Eventually this
can be passed to a function that'll cancel the connection attempt.
I also decided to add an error_cb instead of using connect_cb and
passing a file descriptor of -1. And proxy.c will also pass an
error message to callers which should explain the reason that the
connection attempt failed.
Oh, and proxy.c now never calls gaim_connection_error()
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 12 Aug 2006 10:12:43 +0000 |
parents | 0a0d2a1fd2bc |
children | eaf7f35635bc |
line wrap: on
line source
#include "gntbutton.h" #include "gnt.h" #include "gntkeys.h" #include "gnttree.h" #include "gntbox.h" #include "gntentry.h" #include "gntlabel.h" static void toggled(GntWidget *tree, gpointer key, gpointer null) { GntWidget *w = gnt_box_new(FALSE, FALSE); gnt_box_set_toplevel(GNT_BOX(w), TRUE); gnt_box_add_widget(GNT_BOX(w), gnt_label_new(gnt_tree_get_choice(GNT_TREE(tree), key) ? "Selected" : "NOT")); gnt_widget_show(w); } int main() { #ifdef STANDALONE freopen(".error", "w", stderr); gnt_init(); #endif GntWidget *label = gnt_label_new("So wassup dudes and dudettes!!\nSo this is, like,\nthe third line!! \\o/"); GntWidget *vbox, *hbox, *tree, *box, *button; WINDOW *test; vbox = gnt_box_new(FALSE, FALSE); hbox = gnt_box_new(FALSE, TRUE); gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); gnt_widget_set_name(vbox, "vbox"); gnt_widget_set_name(hbox, "hbox"); gnt_box_add_widget(GNT_BOX(hbox), label); GntWidget *entry = gnt_entry_new("a"); gnt_widget_set_name(entry, "entry"); gnt_box_add_widget(GNT_BOX(hbox), entry); box = gnt_box_new(FALSE, FALSE); tree = gnt_tree_new(); gnt_widget_set_name(tree, "tree"); gnt_box_add_widget(GNT_BOX(box), tree); gnt_box_add_widget(GNT_BOX(hbox), box); gnt_tree_add_row_after(GNT_TREE(tree), "a", gnt_tree_create_row(GNT_TREE(tree), "a"), NULL, NULL); gnt_tree_add_row_after(GNT_TREE(tree), "c", gnt_tree_create_row(GNT_TREE(tree), "c"), NULL, NULL); gnt_tree_add_row_after(GNT_TREE(tree), "d", gnt_tree_create_row(GNT_TREE(tree), "d"), NULL, NULL); gnt_tree_add_row_after(GNT_TREE(tree), "e", gnt_tree_create_row(GNT_TREE(tree), "e"), "a", NULL); gnt_tree_add_choice(GNT_TREE(tree), "b", gnt_tree_create_row(GNT_TREE(tree), "b"), "d", NULL); GNT_WIDGET_UNSET_FLAGS(hbox, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); gnt_box_set_title(GNT_BOX(hbox), "This is the title …"); g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(toggled), NULL); button = gnt_button_new("one"); gnt_widget_set_name(button, "one"); gnt_box_add_widget(GNT_BOX(vbox), button); button = gnt_button_new("two"); gnt_widget_set_name(button, "two"); gnt_box_add_widget(GNT_BOX(vbox), button); button = gnt_button_new("three"); gnt_widget_set_name(button, "three"); gnt_box_add_widget(GNT_BOX(vbox), button); gnt_box_add_widget(GNT_BOX(hbox), vbox); gnt_widget_show(hbox); #ifdef STANDALONE gnt_main(); gnt_quit(); #endif return 0; }