Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows

by beech (Parson)
on Apr 04, 2017 at 00:53 UTC ( [id://1186928]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows
in thread Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows

Bingo! bind('<Enter>'

Nice! This will scroll by wheel even if focus is on the scrollbar

$b->Subwidget('slistbox')->toplevel->bind( '<Enter>', [ $b->Subwidget('slistbox'), 'focus' ] ## no closure here );

Now for the underline, here is how you figure that out

install Tk::WidgetDump, and add  $mw->WidgetDump; to your program before MainLoop

Then run the program, and click on the WidgetDump window

double click the 'listbox' entry which pops up

'Widget Info for Tk::Listbox...' where you click on the first "Option Switch" which pops up

'Edit config' which lets you edit the configuration live,

So change the value, then go back to your mainwindow and see if the underline is still there

Then simply incorporate that into your program

:)

Replies are listed 'Best First'.
Re^6: Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows
by perltux (Monk) on Apr 04, 2017 at 03:48 UTC
    You are right I missed the scrollbar, but:
    $b->Subwidget('slistbox')->toplevel
    can be simply written as:
    $b->Subwidget('choices')

    I figured out the underline is coming from the 'activate' method of Listbox.

    I don't really get the point of the 'activate' method, I'll have to think about how to deal with it.
    I wish I could simply deactivate the 'activate' method altogether... ;)

      Hi

      Does the spoiler work for you?

      $b->Subwidget('slistbox')->configure( -activestyle => 'none' );
      Seems to turn off underlining on windows
        Sorry, I missed the spoiler, yes it works great, many thanks, that solves the last issue.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2025-06-23 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.