Perl/Tk: 'selection conversion left too many bytes unconverted' erroron large text selection


Hi all, I've written about this before, but it's come back and I still haven't found what the problem is. Basically, in Perl/Tk if a textbox has a lot of text in it (no idea on the limit yet - ...
Posted On: Wednesday 28th of November 2012 01:19:33 AM Total Views:  405
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




Binary to Hexadecimal conversion

Hi , I have a $test with 32 bit binary number. $test = 00000000011111000000010111100100 How can i get the hexadecimal number for this.
VIEWS ON THIS POST

105

Posted on:

Wednesday 17th October 2012
View Replies!

file selection dialog - select multiple files over multipledirectories ?

I'm looking for a file selection dialog to enable a user select multiple files and these files may be in multiple directories. I think most file selection dialogs will do multiple files in one dir, but don't know if all do it over multiple dirs. Many
VIEWS ON THIS POST

164

Posted on:

Wednesday 17th October 2012
View Replies!

Gtk2-Perl!How to change color of the selection bar in widget

Hi.I found problem in Gtk2::Perl with module Gtk2::SimpleList. I want to have selection bar in different colors.Not only orange but red blue and others. Sample code produce SimpleList and with moving up and down keys I move with this "orange bar" which I call "select-bar" up and down. How to change this colorPlease for help or any advices. Best regards and thanks in advance. #!/usr/bin/perl -w use Data:umper; use Gtk2 '-init'; use Gtk2::SimpleList; $window = Gtk2::Window->new; $window->set_title ('SimpleList examples'); $window->signal_connect (delete_event => sub {Gtk2->main_quit; TRUE}); $hbox = Gtk2::HBox->new; $window->add ($hbox); $categories = Gtk2::SimpleList->new ('Categories' => 'text'); @{$categories->{data}} = qw/Meat Beer Pizza Pasta Soda Juice Rabbitfood/; $hbox->pack_start ($categories, FALSE, FALSE, 0); $window->show_all; Gtk2->main;
VIEWS ON THIS POST

261

Posted on:

Wednesday 17th October 2012
View Replies!

Re: print a selection of a file

> #!/opt/perl/bin/perl -w > use strict; > > #variable > > my @horcm_file; > > > sub readdata{ > open(HORCM, "/etc/horcm10.conf") || die ("File error"); > @horcm_file = ; > chomp(@horcm_file); > close(HORCM); > return(@horcm_file); > } > > my @pipo=readdata(); > > foreach (@pipo){ > /HORCM_INST/ or next; > print; > } > I would not store the whole file into an array unless you really need this. i would suggest this sollution: my $outputflag = 0; open(HORCM, "/etc/horcm10.conf") || die ("File error"); while(){ if(/HORCM_INST/){ $outputflag = 1; # start printing }elsif($_ eq "\n") { #newline $outputflag = 0; # stop printing } print if $outputflag; } close(HORCM); HTH, Martin
VIEWS ON THIS POST

146

Posted on:

Saturday 20th October 2012
View Replies!

Gtk2-Perl!How to change color of the selection bar in widget

Hi.I found problem in Gtk2::Perl with module Gtk2::SimpleList. I want to have selection bar in different colors.Not only orange but red blue and others. Sample code produce SimpleList and with moving up and down keys I move with this "orange bar" which I call "select-bar" up and down. How to change this colorPlease for help or any advices. Best regards and thanks in advance. #!/usr/bin/perl -w use Data:umper; use Gtk2 '-init'; use Gtk2::SimpleList; $window = Gtk2::Window->new; $window->set_title ('SimpleList examples'); $window->signal_connect (delete_event => sub {Gtk2->main_quit; TRUE}); $hbox = Gtk2::HBox->new; $window->add ($hbox); $categories = Gtk2::SimpleList->new ('Categories' => 'text'); @{$categories->{data}} = qw/Meat Beer Pizza Pasta Soda Juice Rabbitfood/; $hbox->pack_start ($categories, FALSE, FALSE, 0); $window->show_all; Gtk2->main;
VIEWS ON THIS POST

182

Posted on:

Saturday 20th October 2012
View Replies!

How to clear BrowseEntry selection after selection

I have the follow BrowseEntry widget. At the end of the uNotInLst subroutine I want to clear the text showing in the BrowseEntry field. my $addUser = $brEntfr2->BrowseEntry( -autolimitheight => 1, -listheight => 3, -width => 30, -listcmd => [\&uNotInLst, \@userList, \%cigINI], -variable => \$usr2add); $brEntfr2->pack; I have tried many ideas without success. Here is what I have tried: $wgt->Subwidget("slistbox")->selectionClear(0,'end'); $wgt->Subwidget("slistbox")->Subwidget("listbox")->selectionClear(0,'end'); my $belb = $wgt->Subwidget("slistbox"); $belb->selectionClear(0,"end");
VIEWS ON THIS POST

144

Posted on:

Monday 22nd October 2012
View Replies!

Listbox selection reverse

Hi , $f_list = $win-> Scrolled("Listbox", -scrollbars => "se") -> pack(); I have a $f_list defined as Listbox, and I would like to have the most efficient code to reverse the selection done by the user. I will be calling this code when a user clicks on some button.
VIEWS ON THIS POST

140

Posted on:

Tuesday 23rd October 2012
View Replies!

Listbox selection reverse

Hi , $f_list = $win-> Scrolled("Listbox", -scrollbars => "se") -> pack(); I have a $f_list defined as Listbox, and I would like to have the most efficient code to reverse the selection done by the user. I will be calling this code when a user clicks on some button.
VIEWS ON THIS POST

122

Posted on:

Tuesday 23rd October 2012
View Replies!

Highlight selection in a ListBox using arrow keys and enter for selection

I'm new to Perl and I appreciate any help I can get. I'm simply at loss when it comes to highlight an entry in a ListBox when a selection has been made by using arrow keys and enter. When using (mouse)Button-1 highlighting works fine. The listbox gets properly populated and selection can be made both from mouse button-1 and the enter key (positioned by the arrow keys). I assume I need some gizmo code in the sub which is called from the enter key binding. This is simply something I don't manage to solve by myself. Here are some code snippets: # ListBox declaration: my $ProjectListBox = $lf->Scrolled('Listbox', -height=>'0', -width=>'16', -scrollbars=>'e', -selectmode=>'single', -exportselection => 1, ); $ProjectListBox->bind('' => [\&load_project_file_mousebutton,1]); $ProjectListBox->bind('' => [\&load_project_file_enter,1]); $ProjectListBox->pack(qw/-side left -fill both -expand 1/); &BindMouseWheel($ProjectListBox); # relevant subs: sub load_project_file_mousebutton { # Select a project file my $index = $ProjectListBox->curselection; $FILENAME = $ProjectListBox->get($index); &show_project_file; } sub load_project_file_enter { $FILENAME = $ProjectListBox->get('active'); &show_project_file; } Reagrds Jan Karrback , jan_karrback@yahoo.com wrote: > bdz wrote: > > jan_karrback@yahoo.com wrote: > > > > > > > > > I'm new to Perl and I appreciate any help I can get. > > > > > > I'm simply at loss when it comes to highlight an entry in a ListBox > > > when a selection has been made by using arrow keys and enter. also try uslit Tk::HList It has alot of that stuff prebuiltin.
VIEWS ON THIS POST

145

Posted on:

Friday 26th October 2012
View Replies!

Hebrew Calendar conversions?

In comp.lang.perl.misc "Shmuel (Seymour J.) Metz" wrote: : Is there a Perl module for Hebrew->Gegorian and Gregorian->Hebrew date : conversions Did you check CPAN by searching "Hebrew" I saw numerous modules there, also with reference to DateTime and Locale. No idea though whether they offer your required function. Oliver. -- Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
VIEWS ON THIS POST

107

Posted on:

Friday 26th October 2012
View Replies!

Julian Date to Calender date conversion. Please help!

I am new to Perl, I am trying to convert Julian date to calendar date (day of the year). For example, 26711 corresponds to 24-Sep-2011. I tried two approach to this, none being successful. 1) I saw this code online, but this code returns wrong date. This code does not return 24-Sep-2011, instead returns 26-Sep-2011 (Which is wrong!) date_from_yday() { perl -e ' use Time::Local; $yr = $ARGV[0] - 1900; $yday = $ARGV[1]; $mytime = timelocal(1,0,0,1,1,$yr); $mytime += ( 86400 * $yday ); ($sec,$min,$hour,$day,$mon,$yr,$wday,$yday,$whocares) = localtime($mytime); $yr += 1900; printf("%02d/%02d/%d\n", $day, $mon, $yr); ' $2 $1 } date_from_yday 267 2011 ----------- 2) I tried connecting to oracle db and fetch the date. $RETVAL=`"select to_date(nvl(SUBSTR(126711 , 2 , 5) , '00179'), 'DDDYY') from dual" | $ORACLE_HOME/bin/sqlplus -L -S $CONNECT_STRING`; This gives me error saying "select to_date(nvl(SUBSTR(126711 , 2 , 5) , '00179'), 'DDDYY') from dual : not found". I know the connection string is correct because that is used by other queries in the script. Any help is appreciated. If there is a new approach to it, i can try that too. Please help ASAP.
VIEWS ON THIS POST

254

Posted on:

Saturday 3rd November 2012
View Replies!

Binary to Text/ASCii conversion

Dear List Is there any way to conversion from binary file to ascii/text file in perl is there any perl module which works like this
VIEWS ON THIS POST

94

Posted on:

Sunday 4th November 2012
View Replies!

print a selection of a file

, I try to print (get) a specific text selection from a text file, but I don't know how to do it: What I try todo is to open a file search a string and print the follow lines from ...
VIEWS ON THIS POST

161

Posted on:

Saturday 10th November 2012
View Replies!

save gui screenshot as xml file(gui was generated by perltk script)

save gui screenshot as xml file(gui was generated by perltk script)...
VIEWS ON THIS POST

396

Posted on:

Thursday 15th November 2012
View Replies!

Re: selection dialog

--nextPart1690938.udWTXpWCLB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Dne Tuesday 12 July 2005 21:04 jste napsal(a): > I need to make a dialog where it may contain 3+ values for the user to > choose from (1 choice) and then ...
VIEWS ON THIS POST

164

Posted on:

Thursday 15th November 2012
View Replies!

UTF8 to Unicode conversion

I only work in Perl occasionaly, and have been searching for a solution for a conversion, and everything I found seems much too complex. I need to do is take a simple text file [that had been created from ...
VIEWS ON THIS POST

106

Posted on:

Monday 19th November 2012
View Replies!

Re: perltk.org update

--- Matthew Sibley wrote: > Have you considered making it a Wiki I was considering either a wiki or a CMS (content management system). And, to be honest, I was leaning more toward the CMS solution. Mambo ( www.mamboserver.com ...
VIEWS ON THIS POST

127

Posted on:

Sunday 25th November 2012
View Replies!

HList and selection

after creating a HList to build a multicolumn table, I want the focus and selection on the first row. If the path of first row is 1000 I write: $table_hlb->focus; $table_hlb->selectionSet(1000); First question: the focus is actually on first ...
VIEWS ON THIS POST

149

Posted on:

Monday 26th November 2012
View Replies!

selection dialog

I need to make a dialog where it may contain 3+ values for the user to choose from (1 choice) and then they can either click Ok or Cancel. I suppose this could be done either by radiobutton or highlighting. ...
VIEWS ON THIS POST

168

Posted on:

Monday 26th November 2012
View Replies!

Re: perltk.org update

Re: wiki See http://wiki.tcl.tk/ for an example of a wiki being used for tcl/tk ... -- Tcl - The glue of a new generation. Larry W. Virden Even if explicitly stated to the contrary, ...
VIEWS ON THIS POST

494

Posted on:

Wednesday 28th November 2012
View Replies!