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

Re: TabPanel Click event (or workaround) wanted


I think _GetButton() and _TabPanel_Button.class should be public as it's
pretty useful.

I use it to set tooltips on the individual buttons on my editor that show
the file path.
  hMyEditor.OpenFile(sPath)
  TabPanel1._GetButton(Index).ToolTip = sPath

And have used it to monitor events like I have just shown.
(that's why i know this method works bruce :) )

Respects
BruceS


On Fri, 27 Sept 2024 at 11:29, Bruce Steers <bsteers4@xxxxxxxxx> wrote:

> here's the class
>
> https://gitlab.com/gambas/gambas/-/blob/master/comp/src/gb.form/.src/TabPanel/_TabPanelButton.class?ref_type=heads
>
> aah i see the TabButton has a DrawingArea as its first child
>
> I just tested this and it works..
>
>  Public Sub Form_Open()
>
>  Dim $hObs As Observer
>  $hObs = New Observer(TabPanel1._GetButton(0).Children[0]) As "BTN"
>
> End
>
> Public Sub BTN_MouseUp()
>
>   Debug "mouseup"
>
> End
>
> respects
> BruceS
>
>
> On Fri, 27 Sept 2024 at 11:19, BB <adamnt42@xxxxxxxxx> wrote:
>
>>
>> On 27/9/24 7:21 pm, Bruce Steers wrote:
>>
>> You can get buttons as objects with hidden method TabPanel._GetButton()
>>
>> Ie...
>>
>> Dim hObs As Observer
>> hObs = New Observer(TabPanel1._GetButton(0)) As "TabButton"
>>
>> Public Sub TabPanel_MouseUp()
>>
>> Debug "Got MouseUp On The Panel"
>>
>> End
>>
>> Hope that helps :)
>> BruceS
>>
>> No joy. TabPanel1._GetButton(0) gives an Unknown Symbol error.
>>
>> I tried with TabPanel1.TabPanel._GetButton(0) and that eliminates the
>> error but TabButton_MouseUp handler doesn't get invoke.
>>
>> 🙁
>>
>> b
>>
>

Follow-Ups:
Re: TabPanel Click event (or workaround) wantedBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
TabPanel Click event (or workaround) wantedBB <adamnt42@xxxxxxxxx>
Re: TabPanel Click event (or workaround) wantedBruce Steers <bsteers4@xxxxxxxxx>
Re: TabPanel Click event (or workaround) wantedBB <adamnt42@xxxxxxxxx>
Re: TabPanel Click event (or workaround) wantedBruce Steers <bsteers4@xxxxxxxxx>