How to control default bindings? 
Author Message
 How to control default bindings?

        Hi Folks,

        I'm trying to get a menubar setup so it behaves as stated
        in Tcl/Tk's man pages (tk_menubar and menu).  I am not having
        much luck here.

        Yes,  all it takes is a frame and a bunch of menu-buttons,
        with associated menus attached,  but the problem are the
        default bindings!

        Unlike a menubar (defined by tk man pages), we are forced
        to buttonpress each menu-button,  instead of holding down
        and dragging the cursor to the next button and have the
        menu for that button pull down.  There are a few other behaviors
        that dont behave as a menubar should.  I'd prefer to use tk_menuBar
        procedure, but I cannot seem to find nor run this program...

        I tried to play with the tkbinds for the buttons of my
        Menubar class, but sheesh...  it mucks everything up including
        the defaults.  BTW,   I couldn't place tkbinds inside an
        inherited class, either.

        Can someone/anyone give me some advice/help here??

        Many, Many, Many thanks!

---
---------------------------_----------------------------------------------


4640 SW Macadam Ave.   | | | | |    VOICE: [USA] 1+503.228.1400 x251
Portland, OR 97201     | | | | |    FAX:   [USA] 1+503.228.0368
--------------------------------------------------------------------------



Sat, 03 May 1997 02:55:21 GMT  
 How to control default bindings?

Dan> I'm trying to get a menubar setup so it behaves as stated in
Dan> Tcl/Tk's man pages (tk_menubar and menu).  I am not having much
Dan> luck here.

Dan> Yes, all it takes is a frame and a bunch of menu-buttons, with
Dan> associated menus attached, but the problem are the default
Dan> bindings!

Dan> Unlike a menubar (defined by tk man pages), we are forced to
Dan> buttonpress each menu-button, instead of holding down and
Dan> dragging the cursor to the next button and have the menu for that
Dan> button pull down.  There are a few other behaviors that dont
Dan> behave as a menubar should.  I'd prefer to use tk_menuBar
Dan> procedure, but I cannot seem to find nor run this program...

The problem is that you need to take a look at lib/tk/menu.tcl and see
how the procedures implement menubars.  libtk.a doesn't directly
support menu bars (nor single selections in ListBoxes) but instead
implements them in software.  Pretty neat, but makes it tough to
figure things out at times.

I'll try to play with it myself at some point this week and see how
far I can get.  Mostly it looks to be setting up all the bindings
properly for both mouse and keyboard traversal.  If anyone does get
menubars working well, I'm sure Malcolm will add it to the next
release, and I'll be more than happy to add it to the tkperl-scripts
on ftp.wpi.edu:/perl5/

Hmm... now that I think about it, you should be able to just use
Malcolm's TCP::Tcl package once he releases it to run tcl/tk directly
from within perl5.  Kinda a hack I know...



Sat, 03 May 1997 04:45:09 GMT  
 How to control default bindings?

Dan> I looked at lib/tk/menu.tcl, and it was very obvious that most of
Dan> the menu.tcl is re-implemented in lib/perl5/Tk.pm, minus the
Dan> menubar support.  At this point, I gave up because I wasnt sure
Dan> what Malcolm intends to do... there was comments in Tk.pm that
Dan> pointed out places where menubar support should go, and it looked
Dan> like Malcolm is planning to finish these areas up and I'd be
Dan> spinning another wheel wasting my time.

I don't think you would be wasting your time at all.  I know Malcolm
is busy with other work and would appreciate anyone else adding onto
Tkperl5a5.  How mechanical does the translation look to convert from
tcl to tkperl the menu.tcl stuff?  

I'm working on a FileChooser.pm module to implement a directory
browser and file chooser widget so people don't have to write their
own all the time.  It's almost there, just got some sticky problems to
clean up and get rid of, like handling Text input properly... :]

Dan> Would it seem more avantageous to use procedures already written
Dan> in tcl and use them along with perl5 instead of re-writing
Dan> each and every tcl program in perl5/tk ??

I would think it would be more effecient to keep it all within one
program.  I'm wondering how he's going to pass the pointers to window
data back and forth properly, though I seem to remember a message he
posted about it saying he had intelligent caching working.  *shrug*
I'm sure it will work well, but...

Dan> The perl5/tk/tcl mix is starting to look like a witches
Dan> cauldron....  although it might be a pretty interesting mix... eh
Dan> heh heh heh heh...  (Sorry, couldn't resist!)

I think it's looking like a witches brew too, and I think it would
make eventual sense to try and create a more perl centric (or more
accurately, a less tcl centric) version of Tk which would tie in more
naturally to the perl syntax.  

I personally don't like the tcl language, so this would be the ideal
for me.  I guess I should play with the Sx windowing package, but I
hate to have to re-invest all that time in learning more context.

John


 Workstation Specialist - Worcester Polytechnic Institute College Computer Ctr.
                        Kill your television



Sun, 04 May 1997 05:54:18 GMT  
 How to control default bindings?
        I looked at lib/tk/menu.tcl,  and it was very obvious that most
        of the menu.tcl is re-implemented in lib/perl5/Tk.pm,  minus the
        menubar support.  At this point,  I gave up because I wasnt sure
        what Malcolm intends to do... there was comments in Tk.pm
        that pointed out places where menubar support should go,  and it looked
        like Malcolm is planning to finish these areas up and I'd be spinning
        another wheel wasting my time.

        About Malcolm's release of tcl support,  will it be able to read
        and execute tcl programs/procedures?  If so, then why use the Tk.pm
        support routines and just use lib/tk/menu.tcl support procedures?

        Would it seem more avantageous to use procedures already written
        in tcl and use them along with perl5 instead of re-writing
        each and every tcl program in perl5/tk ??

        The perl5/tk/tcl mix is starting to look like a witches cauldron....
        although it might be a pretty interesting mix... eh heh heh heh heh...
        (Sorry,  couldn't resist!)

---
---------------------------_----------------------------------------------


4640 SW Macadam Ave.   | | | | |    VOICE: [USA] 1+503.228.1400 x251
Portland, OR 97201     | | | | |    FAX:   [USA] 1+503.228.0368
--------------------------------------------------------------------------



Sun, 04 May 1997 01:59:41 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. tkperl default binding question !!

2. overriding tkperl default key bindings?

3. listbox default bindings

4. Changing default menubutton bindings

5. Removing default bindings?

6. overriding default right mouse button binding for text widget

7. Overriding default bindings...

8. Text Widget turning off default bindings

9. Changing a default binding

10. Default keyboard bindings in Tk::Text...

11. Overriding a certain default binding???

12. Unbinding default bindings.

 

 
Powered by phpBB® Forum Software