Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Wx with Tk

by Khariton (Sexton)
on Nov 22, 2010 at 20:07 UTC ( [id://873035]=note: print w/replies, xml ) Need Help??


in reply to Re: Wx with Tk
in thread Wx with Tk

I can't answer for long times...
You spent some time to me and big thanks for you.
This is interesting example. It must help me for level up integration of Tk and Wx. But I need one window with Wx GUI and Tk-like canvas functions with drag-n-drop objects.
I see Wx has GL-canvas but I needn't GL. How it works with videocards without 3d acceleration? It's slowly with software 3D emultion? I need only moving 2x object on canvas (pictures, dashed lines...).
You can see my software page to understand what my program doing and my wishes to this project.
Rodovid
p.s.: Also I can't find good full manuals about Wx on Perl...
I find many problems with good documentated Tk on Linux and many new problems when I port it to Windows. With this new problems on Wx I can stop converting my soft to pure Wx for long long time with curved road of probes and mistakes. And may be this times will turn left...
p.p.s.:Sorry for my skill of English. I learn it and can't speak fluently...

Replies are listed 'Best First'.
Re^3: Wx with Tk
by zentara (Archbishop) on Nov 23, 2010 at 13:48 UTC
    Interpreting your English, was a good lesson for me, in how to convey information. I thought "this must be an intelligent person", to get that message across without knowing English. :-)

    Anyways, to your problem. I am almost sure there is a plain WxCanvas, the GLCanvas is probably an extra type. Google for "Wx canvas".

    So, why not just use the WxCanvas, instead of a Tk::Canvas? I think you are mistaken to believe that Wx dosn't have a 2d canvas widget. So google for "WxPerl canvas", and you can be pure Wx. The only reason to keep Tk is if you have some complex Tk::Canvas code that you want to use, but don't quite want to rewrite it in Wx. ;-)

    But if you want to go that mixed route, just setup a timer in Wx

    use Tk qw/MainLoop tkinit DoOneEvent exit DONT_WAIT ALL_EVENTS/; #.... setup your Tk code without a MainLoop statement #then in your Wx timer, put $mw->DoOneEvent( DONT_WAIT | ALL_EVENTS ); # to make Tk responsive

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
      We are must going in another way...
      I solve my problem in another way. May be this will be usefull for another men who using Tk Fbox.pm and need using utf-8 filenames.
      I must using Tk and Wx in one code.But from Wx I use only Filedialog. Why I must use Wx FileDialog?
      Because Tk has embeded problem with UTF-8 filenames. It shows in IconList dialog broken filenames if codepage of filenames different than iso8859-1...
      If I use in my code
      use encoding 'utf8';
      then IconList shows true but I can't choose folders with utf8 names and choosed filename in filedialog shows as ?????.???
      In end of page http://search.cpan.org/~srezic/Tk-804.029/pod/UserGuide.pod I find this:
      Unfortunately, there are still places in Perl ignorant of Unicode. One of these places are filenames. Consequently, the file selectors in Perl/Tk do not handle encoding of filenames properly. Currently they suppose that filenames are in iso-8859-1 encoding, at least on Unix systems. As soon as Perl has a concept of filename encodings, then Perl/Tk will also implement such schemes.
      Early I can't resolve this problem but after You hint for MyMenuButton module(http://www.perlmonks.org/?node_id=866575) I get method how I can resolve my problem.
      I found this:
      1. If I remove all about encoding in FBox(it has only 8859-1 codepage support).
      2. If I add in FBox module
      use encoding 'utf8';
      then all works fine.
      By Your method I insert new MyFBox module in my code. And some corrects in fdialog design for my wishes. I can adding some png pictures instead standart bitmaps...
      Thank You for help!
        Hey, thanks for reporting this solution. To be honest, if I was starting a big project, I would use Gtk2... the code is much more up-to-date.

        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://873035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found