Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

log_window.h File Reference

#include <gtk/gtk.h>
#include <glib.h>

Include dependency graph for log_window.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  _log_window

Typedefs

typedef _log_window log_window

Functions

log_windoweb_log_window_new (struct contact *rc)


Typedef Documentation

typedef struct _log_window log_window
 


Function Documentation

log_window* eb_log_window_new struct contact   rc
 

Definition at line 304 of file log_window.c.

References _, close_log_window_callback(), _log_window::date_html_hbox, _log_window::date_list, _log_window::date_scroller, destroy_event(), _log_window::html_display, load_log_information(), contact::logwindow, contact::nick, _log_window::remote, search_callback(), select_date_callback(), and _log_window::window.

Referenced by eb_view_log().

00305 {
00306   GtkWidget *iconwid0;
00307   GdkPixmap *icon0;
00308   GdkBitmap *mask;
00309 
00310   log_window* lw = g_new0(log_window, 1);
00311   char buffer[512];
00312   GtkWidget* vbox;
00313   GtkWidget* hbox;
00314   GtkWidget* button;
00315   GtkWidget* toolbar;
00316   GtkWidget* search_label;
00317   GtkWidget* search_entry;
00318   lw->remote = rc;
00319   rc->logwindow = lw;
00320   lw->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
00321   gtk_window_set_position(GTK_WINDOW(lw->window), GTK_WIN_POS_MOUSE);
00322   /* show who the conversation is with */
00323   sprintf(buffer, _("Past conversations with %s"), rc->nick);
00324   gtk_window_set_title(GTK_WINDOW(lw->window), buffer);
00325   gtk_container_set_border_width(GTK_CONTAINER(lw->window), 5);
00326   
00327 
00328   /* for the html and list box */
00329   lw->date_html_hbox = gtk_hbox_new(FALSE, 0);
00330 
00331   lw->date_list = gtk_clist_new(1);
00332   gtk_clist_set_column_width(GTK_CLIST(lw->date_list), 0, 100);
00333   gtk_clist_set_selection_mode(GTK_CLIST(lw->date_list), GTK_SELECTION_BROWSE);
00334 
00335   /* scroll window for the date list */
00336   lw->date_scroller = gtk_scrolled_window_new(NULL, NULL);
00337   gtk_widget_set_usize(lw->date_scroller, 180, 150);
00338   gtk_container_add(GTK_CONTAINER(lw->date_scroller), lw->date_list);
00339   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(lw->date_scroller), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
00340   
00341   /* let the packing begin (god that sounds wrong) */
00342   gtk_box_pack_start(GTK_BOX(lw->date_html_hbox), lw->date_scroller, TRUE, TRUE, 5);
00343   vbox = gtk_vbox_new(FALSE, 0);  
00344   gtk_box_pack_start(GTK_BOX(vbox), lw->date_html_hbox, TRUE, TRUE, 5);
00345   gtk_container_add(GTK_CONTAINER(lw->window), vbox);
00346 
00347   gtk_signal_connect(GTK_OBJECT(lw->window), "destroy",
00348              GTK_SIGNAL_FUNC(destroy_event), lw);
00349 
00350   /* buttons toolbar */
00351   hbox = gtk_hbox_new(FALSE, 0);
00352   toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
00353   gtk_toolbar_set_button_relief(GTK_TOOLBAR(toolbar), GTK_RELIEF_NONE);
00354   gtk_container_set_border_width(GTK_CONTAINER(toolbar), 0);
00355 
00356   /* need to realize the window for the pixmaps */
00357   gtk_widget_realize(GTK_WIDGET(lw->window));
00358 
00359 
00360   /* search field */
00361   search_label = gtk_label_new(_("Search: "));
00362   search_entry = gtk_entry_new();
00363   gtk_box_pack_start(GTK_BOX(hbox), search_label, FALSE, FALSE, 0);
00364   gtk_box_pack_start(GTK_BOX(hbox), search_entry, TRUE, TRUE, 0);
00365   gtk_widget_show (search_label);
00366   gtk_widget_show (search_entry);
00367   gtk_signal_connect(GTK_OBJECT(search_entry), "key_press_event",
00368              GTK_SIGNAL_FUNC(search_callback), lw);
00369 
00370   
00371   /* close button*/
00372   icon0 = gdk_pixmap_create_from_xpm_d(lw->window->window, &mask, NULL, cancel_xpm);
00373   iconwid0 = gtk_pixmap_new(icon0, mask);
00374   gtk_widget_show(iconwid0);
00375   button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
00376                    GTK_TOOLBAR_CHILD_BUTTON,
00377                    NULL,
00378                    "close",
00379                    "Close",
00380                    "close",
00381                    iconwid0,
00382                    GTK_SIGNAL_FUNC(close_log_window_callback),
00383                    lw);
00384   gtk_widget_show(GTK_WIDGET(button));
00385   gtk_widget_show(GTK_WIDGET(toolbar));
00386 
00387   gtk_box_pack_end(GTK_BOX(hbox), toolbar, FALSE, FALSE, 0);
00388   gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
00389 
00390   /* connect signals to the date list */
00391   gtk_signal_connect(GTK_OBJECT(lw->date_list), "select-row", 
00392              GTK_SIGNAL_FUNC(select_date_callback), lw);
00393 
00394   load_log_information(lw);  
00395 
00396   /* show everything... can you get arrested for baring it all? */
00397   gtk_widget_show(GTK_WIDGET(lw->date_list));
00398   gtk_widget_show(GTK_WIDGET(lw->html_display));
00399   gtk_widget_show(GTK_WIDGET(lw->date_scroller));
00400   gtk_widget_show(GTK_WIDGET(lw->date_html_hbox));
00401   gtk_widget_show(GTK_WIDGET(hbox));  
00402   gtk_widget_show(GTK_WIDGET(vbox));
00403 
00404   gtk_widget_show(GTK_WIDGET(lw->window));
00405 
00406   gtk_clist_select_row(GTK_CLIST(lw->date_list), 0, 0);
00407 
00408   return lw;
00409 }


Contact: Andy Maloney     [Documentation generated by doxygen]