[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Printing and weird (non-latin0 ;-) ) charsets -- summary



On 29 May 2002, Lars Clausen wrote:

> The freetype font selection widget contains a small hack that I stole from
> Dillo, which allows menus to scroll.  Easily adaptable for the GDK font
> menu (though not going in for .90, I guess).
>
> -Lars

Thank you. I have adapted the hack for the GDK font
menu. I don't understand the gtk functions but the
hack seems to work. I added some delay to slow down
the scrolling speed (using the usleep function, which
may not be available on some systems).

The hack is attached here for those who may want to
use this feature before an official fix is released.

I'm quite satisfied with the current state
of Dia. The only unpleasant issue now is
the delay when opening a Chinese font
(10 seconds on a 800MHz PIII), but I think
this problem is in XFree86, not in dia.

I'm waiting for the release of 0.91, which is
supposed to support everything I need to draw
diagrams in simplified Chinese and export them
to PS.

Thanks to all developers for their excellent work.

-LB

--
--- dia-0.90.RC2.orig/lib/widgets.c	Tue May  7 15:23:17 2002
+++ dia-0.90.RC2/lib/widgets.c	Thu May 30 09:28:44 2002
@@ -66,7 +66,6 @@
   object_class = (GtkObjectClass*) class;
 }
 
-#ifdef HAVE_FREETYPE
 /* This function is stolen from dillo.
  */
 static void
@@ -87,12 +86,16 @@
 			   &mx, &my, NULL, NULL, NULL);
   sh = gdk_screen_height ();
 
-  if (y + my < 0)
+  if (y + my < 0) {
+    usleep(50000);
     gdk_window_move (widget->parent->parent->window, mx, - y + 1);
-  else if (y + my > sh - h)
+  } else if (y + my > sh - h) {
+    usleep(50000);
     gdk_window_move (widget->parent->parent->window, mx, sh - h - y - 1);
+  }
 }
 
+#ifdef HAVE_FREETYPE
 static void
 dia_font_selector_font_selected(GtkWidget *button, gpointer data)
 {
@@ -183,30 +186,32 @@
   gtk_box_pack_start_defaults(GTK_BOX(fs), GTK_WIDGET(fs->style_omenu));
 #else
   GtkWidget *menu;
-  GtkWidget *submenu;
+  GtkWidget *omenu;
   GtkWidget *menuitem;
-  GSList *group;
   GList *list;
   char *fontname;
   
+  omenu = gtk_option_menu_new();
+  fs->font_omenu = GTK_OPTION_MENU(omenu);
   menu = gtk_menu_new ();
   fs->font_menu = GTK_MENU(menu);
-  submenu = NULL;
-  group = NULL;
 
   list = font_names;
   while (list != NULL) {
     fontname = (char *) list->data;
-    menuitem = gtk_radio_menu_item_new_with_label (group, fontname);
+    menuitem = gtk_menu_item_new_with_label (fontname);
     gtk_object_set_user_data(GTK_OBJECT(menuitem), fontname);
-    group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
+    gtk_signal_connect(GTK_OBJECT(menuitem), "select", dia_font_selector_scroll_popup, NULL);
     gtk_menu_append (GTK_MENU (menu), menuitem);
     gtk_widget_show (menuitem);
 
     list = g_list_next(list);
   }
   
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (fs), menu);
+  gtk_option_menu_set_menu (GTK_OPTION_MENU (fs->font_omenu), menu);
+  gtk_widget_show(menu);
+  gtk_widget_show(omenu);
+  gtk_box_pack_start_defaults(GTK_BOX(fs), GTK_WIDGET(fs->font_omenu));
 #endif
 }
 
@@ -233,7 +238,7 @@
       (GtkArgGetFunc) NULL
     };
     
-#ifdef HAVE_FREETYPE
+#if 1	// #ifdef HAVE_FREETYPE
     dfs_type = gtk_type_unique (gtk_hbox_get_type (), &dfs_info);
 #else
     dfs_type = gtk_type_unique (gtk_option_menu_get_type (), &dfs_info);
@@ -330,7 +335,7 @@
 
   dia_font_selector_set_styles(fs, font);
 #else
-  gtk_option_menu_set_history(GTK_OPTION_MENU(fs), font_nr);
+  gtk_option_menu_set_history(GTK_OPTION_MENU(fs->font_omenu), font_nr);
   gtk_menu_set_active(fs->font_menu, font_nr);
 #endif
 }
--- dia-0.90.RC2.orig/lib/widgets.h	Tue Apr 23 15:23:08 2002
+++ dia-0.90.RC2/lib/widgets.h	Thu May 30 08:35:17 2002
@@ -54,6 +54,7 @@
 #else
   GtkOptionMenu omenu;
 
+  GtkOptionMenu *font_omenu;
   GtkMenu *font_menu;
 #endif
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK